-
Notifications
You must be signed in to change notification settings - Fork 76
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
Provide context to modal setFocus
method where focus is set on the close button
#5856
Comments
The outcome of #5147 will likely impact this issue. We are looking into using cc @geospatialem for any a11y insights |
@benelan's note above is correct on the modal's close button as the first focusable element. The change is a result of the #5270 introduction mentioned above, aligned with a11y standards and recommendations as the first focusable content in the component per WCAG Success Criterion 2.4.3: Focus Order. The success criterion listed as
This is not a recommended approach since it would bypass the first focusable item and wouldn't align with what is depicted visually in the component. Of note, there is also a timing mechanism associated with the |
Agreed, but #5270 is a backwards compatibility break of the API because it deviates from the modal's documented Understandable if this is more of a documentation clean-up issue, rather than a bug fix issue, though. Footnotes |
setFocus
method where focus is set on the close button
**Related Issue:** #5856 ## Summary Add context to the `modal`s `setFocus` method where the focus will be set on the component's "close" button.
Installed and assigned for verification. |
Verified on the |
Actual Behavior
When opening a modal with
disable-close-button
disabled, the close button now always gains the initial focus.If
disable-close-button
is enabled, thecontent
slot is checked for focusable elements before the button slots, even if the buttons appear before thecontent
slot in the DOM.Expected Behavior
When opening a modal, the close button only gains the initial focus if there's nothing to focus in the
content
slot and/or there're no button slots to focus. The order in which slots are checked is dependent on the order in which they appear in the DOM.Reproduction Sample
https://codepen.io/nwhittaker-esri/pen/jOKvKry
Reproduction Steps
disabled-close-button
on the modal and see the input gains focus instead of the primary buttonReproduction Version
next.647
Relevant Info
Introduced by #5270.
Regression?
next.631
Impact
This regression is breaking auto-focus behaviors in our modals and causing integration tests to fail. Specifically in modals that we want to have a close button, but also want to initially auto-focus a button or some element in the
content
slot.Esri team
ArcGIS Field Apps
The text was updated successfully, but these errors were encountered: