-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
export focusable element selector #7117
base: develop
Are you sure you want to change the base?
export focusable element selector #7117
Conversation
Generate changelog in
|
"button:not([disabled]),input,[tabindex]:not([tabindex='-1'])", | ||
), | ||
); | ||
const elements = Array.from(popoverContentRef.current.querySelectorAll<HTMLElement>(Utils.SELECTOR_FOCUSABLE)); |
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.
Why are these additional selectors necessary for the date input components? Can you provide a brief summary of why we want to make this change?
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.
They are definitely not necessary, there is no functional change either. I had just found this and thought we could re-use the "get focusable elements" code.
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.
Looking into it a bit, it looks like there is a slight functional change to the default tab focusing behavior in DateInput3, but the change appears to be beneficial. We can see the before/after here where the current tab behavior skips over the month and year in focusing the elements within the picker:
before.mp4
after.mp4
I'm in favor of us merging this since it also seems to fix this subtle bug.
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.
Awesome, didn't know we were fixing a bug with that change but yep that change is definitely what we want!
Fixes #0000
Checklist
Changes proposed in this pull request:
Export the selector for all focusable elements