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(Filename): remove tabindex when status is complete #12105

Merged
merged 2 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/react/src/components/FileUploader/Filename.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function Filename({ iconDescription, status, invalid, ...rest }) {
<CheckmarkFilled
aria-label={iconDescription}
className={`${prefix}--file-complete`}
{...rest}>
{...rest}
tabIndex={null}>
Copy link
Contributor

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?

Copy link
Collaborator Author

@tw15egan tw15egan Sep 16, 2022

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!

Copy link
Collaborator Author

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}

{iconDescription && <title>{iconDescription}</title>}
</CheckmarkFilled>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@
}

.#{$prefix}--file__state-container .#{$prefix}--file-complete {
cursor: pointer;
fill: $interactive;

&:focus {
Expand Down