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(react): update how isExpandedAll is set and ensure onExpand called #12138

Merged

Conversation

abbeyhrt
Copy link
Contributor

@abbeyhrt abbeyhrt commented Sep 22, 2022

Closes #11871

This PR:

  • fixes a bug, when DataTable was used with Pagination the toggle expansion button wasn't updated properly, by having isExpandedAll be set to true in getDerivedStateFromProps when all rows are expanded, the button changes toggle as expected
  • also noticed that onExpand wasn't being called if getExpandHeaderProps was provided so I added that in to the click handler for that
  • add tests for both of those issues to prevent regression

Changelog

New

  • {{new thing}}

Changed

  • {{change thing}}

Removed

  • {{removed thing}}

Testing / Reviewing

Go to Test Toggle story and click the "Expand all" chevron and then go to the next page. Verify that the chevron has flipped back to the "unexpanded" state.

@abbeyhrt abbeyhrt requested a review from a team as a code owner September 22, 2022 22:55
@netlify
Copy link

netlify bot commented Sep 22, 2022

Deploy Preview for carbon-components-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 5c42e70
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-react/deploys/633dd9f84007a20008f374ed
😎 Deploy Preview https://deploy-preview-12138--carbon-components-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Sep 22, 2022

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 5c42e70
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/633dd9f8f12c640008aa2858
😎 Deploy Preview https://deploy-preview-12138--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@kodiakhq kodiakhq bot merged commit 19fea2e into carbon-design-system:main Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Bug]: Expand all toggleBtn doesn't reflect a state change when using pagination
3 participants