Open Magsu opened 1 month ago
Is it worth to use popover attribute for dialog? https://hidde.blog/popover-accessibility/ It doesn't resolve an issue with focus but is it helpful for any screen reader?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/showModal
"Interaction outside the dialog is blocked and the content outside it is rendered inert."
Provide a general summary of the issue here
When using keyboard or screen reader and navigating with tab, the modal dialog is not a closed environment. When using keyboard or screen reader, the focus in an element with the role “dialog” should be contained in the element. Though a bit counterintuitive, this also includes the browser elements.
🤔 Expected Behavior?
When using keyboard or screen reader and navigating with tab, the focus stays inside the modal, and doesn’t “leak” outside of it to the browser elements or the web page below the modal.
😯 Current Behavior
The user can access the browser elements and the page below when a modal is open and using tab.
💁 Possible Solution
When in a modal the focus should be locked using the following method: • Find the first and last focusable element programmatically • When user has focus in the last element of the modal, if the user presses the “Tab”-key, move focus to the first focusable element • When user has focus in the first element of the modal, if the user pressed “Shift + Tab” key combination, move focus to the last focusable element
🖥️ Steps to Reproduce
What browsers are you seeing the problem on? (only for bugs in code)
Chrome
If other, please specify.
No response
What operating system are you using?
Windows 10
👤 Your name
Valtteri Järvinen
🧢 Your product/team
External
🎨 Your Theme(s)
Sanoma Learning