-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
feat(DataTable): close batch actions when selected items are removed #9679
feat(DataTable): close batch actions when selected items are removed #9679
Conversation
✔️ Deploy Preview for carbon-react-next ready! 🔨 Explore the source changes: aa7aa61 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-react-next/deploys/6148955139f128000790586b 😎 Browse the preview: https://deploy-preview-9679--carbon-react-next.netlify.app |
DCO Assistant Lite bot All contributors have signed the DCO. |
6b25c45
to
4ba5924
Compare
I have read the DCO document and I hereby sign the DCO. |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: 6b25c45 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/6142fc244ed7c30007621332 😎 Browse the preview: https://deploy-preview-9679--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: 6b25c45 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/6142fc24ee54c80008447d3b 😎 Browse the preview: https://deploy-preview-9679--carbon-components-react.netlify.app |
recheck |
✔️ Deploy Preview for carbon-elements ready! 🔨 Explore the source changes: aa7aa61 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-elements/deploys/6148955109147300080772f2 😎 Browse the preview: https://deploy-preview-9679--carbon-elements.netlify.app |
✔️ Deploy Preview for carbon-components-react ready! 🔨 Explore the source changes: aa7aa61 🔍 Inspect the deploy log: https://app.netlify.com/sites/carbon-components-react/deploys/6148955147967a000791ef82 😎 Browse the preview: https://deploy-preview-9679--carbon-components-react.netlify.app |
Closes #9586
Change the
shouldShowBatchActions
logic to only be true when there is at least one selected row.Changelog
Changed
DataTable
getBacthActionProps
now takesselectedRows.length
into account when returningshouldShowBacthActions
, the same wayhandleOnSelectRow
does. The reason for this is the number of selected rows can be changed from outsidehandleOnSelectRow
, for example if the selected row gets deleted in the component that wraps theDataTable
.Testing / Reviewing
Check out the repository, and using the demo component in the DataTable-batch-actions-story.js, implement the logic for the "Delete" button. Let me know if I should provide a test example!