-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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(data-table): use unselectAll translation key if selection checkbox is indeterminate #4570
fix(data-table): use unselectAll translation key if selection checkbox is indeterminate #4570
Conversation
Deploy preview for the-carbon-components ready! Built with commit f069b6f https://deploy-preview-4570--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit f069b6f https://deploy-preview-4570--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit f069b6f |
Tested react version. Looks good! Thanks, @jendowns! |
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!
? translationKeys.unselectAll | ||
: translationKeys.selectAll; | ||
const translationKey = | ||
checked || indeterminate |
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.
checked || indeterminate | |
(checked || indeterminate) |
Does prettier end up taking away the parenthesis here? There seems to be some syntax ambiguity that adding these in might help with. Otherwise, seems great!
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.
yeah prettier will remove parentheses there. by default it is evaluated as (checked || indeterminate) ? ... : ...
rather than checked || (indeterminate ? ... : ...)
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.
looks good to me
Closes #4556
Changelog
Changed
indeterminate
checkbox (as well aschecked
to determinate iftranslationKeys.unselectAll
is usedTesting / Reviewing
Open the
carbon-components-react
deploy and follow the steps in #4556 -- directly select only a few rows, and then check thearia-label
of the indeterminate icon. It should say "unselect all rows" instead of "select all rows"