-
Notifications
You must be signed in to change notification settings - Fork 57
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
Focus should not leave OMB Component Modal #2207
Focus should not leave OMB Component Modal #2207
Comments
Hey team! Please add your planning poker estimate with Zenhub @Andrew565 @ataker @harshil1793 @it-harrison @jamigibbs @micahchiang @nickjg231 @powellkerry @rmessina1010 @rsmithadhoc |
Since opening this ticket, I discovered another issue with the modal. When the modal is closed, focus is lost. The keyboard seems to be below the button, but when you press tab, the phone number in the footer gets the focus indicator. However, if you just close the modal, the screen reader announces the Page <title>. When the modal closes, focus should return to the "Privacy act" button, and the privacy act button should be announced. The correct behavior is displaying properly in the modal in storybook, but not in the omb component in storybook. Here is a video OMB-component.mov |
cross referencing as could be similar to this issue. 2255 |
The Problem with Modal Focus TrappingCurrently modals use a "focusin" listener to detect when focus leaves the modal and enters the main body of a document. The Shadow DOM messes up the "focusin" listener, such that it doesn’t fire for anything inside of a Shadow DOM.
This article suggests using
Options
(This was also posted to Slack, will update here when any decisions are made.) |
The solution decided on was to attach 'focus' listeners to the modal-triggering buttons for the OMB Info and Crisis Line Modal components, which appears to work well enough for our needs. |
After receiving more feedback from Ryan, the following work still needs to be done:
Because of these additional requirements, I adjusted the point estimate for this ticket from 3 to 5, and expect that it will carry over. CC @humancompanion-usds , @caw310, @micahchiang |
Bug Report
What happened
In the 508 audit on form 21-10210, received this note from the 508 office regarding the OMB component.
I was able to recreate this in storybook. It never happens when you just tab. But when you shift+tab (reverse tab) the focus leaves the modal. If you try this on the regular modal component, the focus never leaves the modal itself.
What I expected to happen
The focus to never leave the modal
Reproducing
Steps to reproduce:
<title>
is read, and then it just starts reading down the page.Urgency
How urgent is this request? Please select the approriate option below and/or provide details
Details
The text was updated successfully, but these errors were encountered: