-
Notifications
You must be signed in to change notification settings - Fork 81
feat: add button-tab-index-required
rule
#11719
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
base: dev
Are you sure you want to change the base?
feat: add button-tab-index-required
rule
#11719
Conversation
ee75ac7
to
b22d93d
Compare
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
button-tab-index-required
rule
@anveshmekala I'm not finding any info about Safari requiring a tabindex on buttons. I also can't see any difference in a codepen: https://codepen.io/driskull/pen/OPJKRbw Are you sure the issue wasn't related to focus trapping and incorrectly closing the input-date-picker? |
I think there may be a larger issue with the component, even clicking on the background of the open date picker shouldn't close it. This is an inconsistency between Safari and Chrome and adding the tabindex to the button doesn't fix that part. |
The issue seems to be with the |
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'm not sure this is necessary but I'll defer to @jcfranco.
I don't think safari needs tabindex set and can't seem to find any information to back that up.
The root of the issue is the blur event causing the component to close in Safari the button being focused does hide the issue but the root of the issue persists and clicking not on a button within the datepicker shouldn't close it either. |
True & Agree. We can freeze this one & fix the root cause. Can you add a bug for the issue with input-date-picker. |
This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions. |
Related Issue: #11941
Adds a new custom ESLint rule.
Summary
button-tab-index-required
This rule will catch any button elements without
tabIndex
attribute.tabIndex
attribute is required for button to be focusable when clicked in Safari browser.Config
No config is needed
Usage