-
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(Filename): remove tabindex when status is complete #12105
Conversation
✅ Deploy Preview for carbon-components-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
@@ -36,7 +36,8 @@ function Filename({ iconDescription, status, invalid, ...rest }) { | |||
<CheckmarkFilled | |||
aria-label={iconDescription} | |||
className={`${prefix}--file-complete`} | |||
{...rest}> | |||
{...rest} | |||
tabIndex={null}> |
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.
Out of curiosity, what would the difference, if any, be between having tabIndex equal null or tabIndex equal to -1?
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.
When a prop is set to null
it shouldn't render that prop on the component at all. Since it's an SVG and they don't support tabIndex
, I figured I'd just remove it in that case. Usability wise they accomplish the same thing!
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.
I think the main use case of this would be a disabled
prop where you would do something like disabled={disabled ? true : null}
Closes #12101
Removes the
tabindex
when the status iscomplete
, as this is just a status icon, and no action can be taken by clicking the icon in this stateChangelog
Changed
complete
complete
Testing / Reviewing
Run a11y checker on the
Filename
example when the status iscomplete
. No violations should appear