-
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
fix(table-batch-action): remove default iconDescription, add proptype check, update stories #3928
Conversation
Deploy preview for the-carbon-components ready! Built with commit 61634e4 https://deploy-preview-3928--the-carbon-components.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 61634e4 |
Deploy preview for carbon-components-react ready! Built with commit 61634e4 https://deploy-preview-3928--carbon-components-react.netlify.com |
Deploy preview for the-carbon-components ready! Built with commit b3fa472 https://deploy-preview-3928--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit b3fa472 https://deploy-preview-3928--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit b3fa472 |
*/ | ||
iconDescription: PropTypes.string.isRequired, | ||
hasIconOnly: PropTypes.bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is hasIconOnly
being used anywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right, it's not 😅
I could update the batch actions story to include sample usage of hasIconOnly
with iconDescription
? Something like this, maybe for that last button in the batch actions series ("Download"):
<TableBatchAction
hasIconOnly
renderIcon={Download}
iconDescription="Download the selected rows"
onClick={batchActionClick(selectedRows)}
/>
Or would you prefer to remove hasIconOnly
from this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 - Thanks @jendowns!
Closes #3809
The 2 big takeaways for me from #3809 are:
iconDescription
is not necessary (and shouldn't be present)iconDescription
should not be "Add" by default because that adds noise for screen readersBoth of these points are very similar to what's been changed with the
Button
's props recently (https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/Button/Button.js#L177) , so I used that component as a guide here.Changelog
New
hasIconOnly
button prop inTableBatchAction
(referring to same prop inButton
: https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/Button/Button.js#L189)Changed
iconDescription
is no longer requirediconDescription
prop type to add similar warning as the one that already exists inButton
(https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/Button/Button.js#L177)Removed
iconDescription
(same as inButton
- https://github.com/carbon-design-system/carbon/blob/master/packages/react/src/components/Button/Button.js#L204)iconDescription
value because button text is already provided in all of those examplesTesting / Reviewing
Please note that I am unable to test in JAWS myself (cc @dakahn how should we verify this? thanks for your help!)