-
Notifications
You must be signed in to change notification settings - Fork 77
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
feat(input-date-picker): add focus trap support #6816
feat(input-date-picker): add focus trap support #6816
Conversation
…nput or entering the down key
+@geospatialem for a11y testing. |
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.
FocusTrap related changes look good!
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.
Likely out of scope for the focus trap support, and also nitpick:
Would we want to support keyboard focus where the "previous month" button is focused on first?
Could see this being confusing for mouse users, too, but it seems like an odd behavior for AT to have to tab in after the dialog is displayed. Also makes it harder for AT users to close the dialog, as they would need to tab in first, then press esc
.
@geospatialem I updated it so that when the date-picker is opened via the ⬇ key, it gets focused. Clicking won't move focus to allow users to type the value if desired. |
Related Issue: #6668
Summary
Adds focus-trap to date-picker dialog to improve a11y.
Note: This also adds a util to help retrieve props from the currently focused element.
Notable
focusTrapComponent
changesconnectFocusTrap
now supports passing a different focus-trap target element (for setting the focus trap on a component's subtree) and overrides to certain options fromfocus-trap
'sfocusTrap()
.activateFocusTrap
/deactivateFocusTrap
now allow passing options tofocus-trap
'sactivate
/deactivate
methods.updateFocusTrapElements
is now optional.