Disable tabbing on modal content when hidden
See original GitHub issueI know that the recommendation is to have this css:
[aria-hidden="true"] {
display: none;
}
However that solution leaves much to be desired in terms of in-out transitions using CSS.
Since the modal code already implements the ability to disable focus on elements, as used on the modals siblings, would it be possible to do the same thing for the modal content when closing the modal?
This would enable the ability to use other means of hiding the visual side of the dialog when closing it, which includes transitions in and out.
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (14 by maintainers)
Top Results From Across the Web
Disable tabbing on modal content when hidden #70 - GitHub
This would enable the ability to use other means of hiding the visual side of the dialog when closing it, which includes transitions...
Read more >How can restrict the tab key press only within the modal popup ...
1. disable screenreader interaction with any other nodes by setting aria-hidden=true on them · 2. disable any keyboard interaction with them · 3....
Read more >How to trap focus inside modal to make it ADA compliant
tab, shift + tab and enter key and focus should be trapped inside modal and should not go out after pressing tab key...
Read more >A CSS Approach to Trap Focus Inside of an Element
To summarize, when inside a dialog, pressing Tab or Shift+Tab should cycle the focus within the dialog only—amongst the focusable elements ...
Read more >Modal · Bootstrap v5.0
Modals are built with HTML, CSS, and JavaScript. They're positioned over everything else in the document and remove scroll from the <body> so...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I thought it might be a useful addition so the default unstyled version did the correct thing with tabbing, and so it could avoid forcing a styling on the users.
I thought it wouldn’t be a big addition, since the modal is already dealing with toggling tabindexes, so it would probably be a smaller implementation in the library itself than if someone would have to to it themselves.
I’m comfortable with implementing this in my own code, but should you decide to full a functionality like this into the core I’d be happy to contribute with test cases
For the record, here is how I would write it: