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(Datagrid): use selectedRowIds to set selected rows #3123

Conversation

matthewgallo
Copy link
Member

@matthewgallo matthewgallo commented Jun 13, 2023

Contributes to #3045

Addresses issue where items are preselected across multiple pages. The batch action toolbar would only render when you changed to the page containing the selected item/s. This behavior can be seen from the code sandbox provided by @K-Markopoulos (thank you!).

The story Select Items in All Pages also was breaking after the storybook 7 merge because onSelectAllRows was called before being defined.

What did you change?

packages/ibm-products/src/components/Datagrid/Datagrid.stories.js
packages/ibm-products/src/components/Datagrid/Datagrid/DatagridSelectAllWithToggle.js
packages/ibm-products/src/components/Datagrid/Datagrid/DatagridToolbar.js
packages/ibm-products/src/components/Datagrid/_storybook-styles.scss

How did you test and verify your work?

Storybook

@matthewgallo matthewgallo requested a review from a team as a code owner June 13, 2023 13:58
@netlify
Copy link

netlify bot commented Jun 13, 2023

Deploy Preview for carbon-for-ibm-products ready!

Name Link
🔨 Latest commit 8ed0ab8
🔍 Latest deploy log https://app.netlify.com/sites/carbon-for-ibm-products/deploys/6488760969933200082cd779
😎 Deploy Preview https://deploy-preview-3123--carbon-for-ibm-products.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.

@elycheea
Copy link
Contributor

@matthewgallo merging this to resolve the Storybook issue in Datagrid but I think we still need v1 for this one.

@elycheea elycheea merged commit 426b8b4 into carbon-design-system:main Jun 13, 2023
@matthewgallo matthewgallo deleted the 3045-select-all-items-in-all-pages branch June 13, 2023 18:43
@elycheea
Copy link
Contributor

LOL. Never mind. You opened it as I clicked merge. 😂

@matthewgallo
Copy link
Member Author

Great timing! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done 🚀
Development

Successfully merging this pull request may close these issues.

3 participants