Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(table): auto-collapse expanded row upon clicking another expandable row #793

Merged
merged 31 commits into from
Oct 28, 2024

Conversation

ckrook
Copy link
Collaborator

@ckrook ckrook commented Oct 10, 2024

Describe pull-request

This pull-request adds the possibility for the developer to enable "auto collapse". This means that if its enabled, all other rows except for the row selected will be closed.

Issue Linking:

Choose one of the following options

How to test

Provide detailed steps for testing, including any necessary setup.

  1. Go to Storybook
  2. Navigate to the table component
  3. Go to expandable rows
  4. Toggle the control autoCollapse to true
  5. Test open multiple rows now, the expected behavior is that all other rows expect the selected row should close

Checklist before submission

  • I have added unit tests for my changes (if applicable)
  • All existing tests pass
  • I have updated the documentation (if applicable)

Suggested test steps

  • Browser testing (Chrome, Safari, Firefox)
  • Keyboard operability
  • Storybook controls

@ckrook ckrook changed the title Cdep 3490 auto collapse expanded row fix(table): auto-collapse expanded row upon clicking another expandable row Oct 10, 2024
Copy link
Contributor

github-actions bot commented Oct 10, 2024

Playwright test results

passed  390 passed
skipped  1 skipped

Details

stats  391 tests across 132 suites
duration  53.4 seconds
commit  930461b

Skipped tests

src/components/table/table/test/expandable-row-autocollapse/expandable-row-autocollapse.e2e.ts › tds-table-expandable-row-autoCollapse › NEEDS FIXING: expanding one row collapses the others when autoCollapse is true

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-793.d3fazya28914g3.amplifyapp.com

@ckrook ckrook closed this Oct 10, 2024
@ckrook ckrook reopened this Oct 10, 2024
@theJohnnyMe
Copy link
Contributor

Something is off with the story controls on this one, lets take a look together on it later today.
Screenshot 2024-10-16 at 10 33 18

@ckrook
Copy link
Collaborator Author

ckrook commented Oct 22, 2024

Last Thursday before release Nathalie noticed in Storybook that each row was logged upon click on a row.
I have resolved this issue with my latest commit.

Copy link
Contributor

@nathalielindqvist nathalielindqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preview link is still showing the previous issues with the multiple id's, the build might need quite som time before updating 🤔
However, when running the branch locally I get an error when setting Auto Collapse to true:
Screenshot 2024-10-22 at 10 41 18

No id's are being logged in the console after that

@ckrook
Copy link
Collaborator Author

ckrook commented Oct 24, 2024

@nathalielindqvist Thanks for the catch, I have committed a fix for this :)

ckrook and others added 2 commits October 25, 2024 11:30
Copy link
Contributor

@nathalielindqvist nathalielindqvist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Please be mindful when merging if this PR is merged before yours, you might need to rebase again in that case :)

Copy link

@ckrook ckrook merged commit 11e389c into develop Oct 28, 2024
3 checks passed
@ckrook ckrook deleted the CDEP-3490-Auto-collapse-expanded-row branch October 28, 2024 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants