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
Modal Window isn't fully accessible - WCAG 2.0 - 2.1.2 No Keyboard Trap #8855
Comments
Teemu remembered that the focus trap causing this problem was implemented in Fw7 as a bugfix, to stop the focus from leaving the modal dialog. Issue imported to Fw repo: |
The user should not be allowed to leave the modal windows, that's correct. Just the way how it was implemented is kinda broken. |
The current fix is not perfect, but "good enough", in that it does circulate the focus to the top of the dialog when Tab was pressed on the last component of the dialog, and similarly for Shift+Tab. Known issues are:
|
Hey Peter, thank you for your work! I can investigate the framework behaviour after your pr gets approved and merged to see how it works for our sightless user. I think that's okay because we kinda knew the limitation of your second point. Additional I had the following idea:
Example:
|
Hi @knoobie, reliably catching the focus moving away from the trap is relatively difficult thing to catch. If you have an idea how to catch it and move the focus from one trap to the other, we'd love to see it in a PR and test it. Especially if it's less complex and easy to understand! |
In our project we created a focusable element to the end of the Window which only purpose is to move the focus to the Window's first element when it's focus listener is called. To prevent the focus leaving the other way around (Shift + Tab) there is also another focusable element in beginning of the Window that moves the focus to the last component of the Window. There are still special cases where this won't work, e.g. manually set tab indices to same number in the underlying UI and within the Window |
That's pretty much what @torok-peter did in his patch for the whole Window. When focusing the trap it moves to focus to the first/last element. |
@Wnt @tsuoanttila - I had the same idea with my example above. I wanted to reused the current elements that traps the user/focus in the window - instead of blocking tabbing there, the tab should navigate the user to the other side of the window. This of course adds two invisible focusable fields to the UI that are kinda annoying as well - but only at the start and end of the window (with aria-label of course) so it's okay I guess. Focus == bottom && Key == TAB => Focus == top && Key == TAB && SHIFT => |
The current implementation of all modal windows act as keyboard trap and don't comply to the WCAG 2.0 - 2.1.2 No Keyboard Trap
Vaadin Version:
All
Example:
http://demo.vaadin.com/sampler/#ui/structure/window
Steps to reproduce:
Expected behaviour:
Source: WCAG 2.0 - 2.1.2 No Keyboard Trap
Current behaviour:
Additional problem:Focused min/max/close Icons don't get a focus indicator when using the keyboard to navigate. Mouse:hover works fine.Moved additional problem to #8918
The text was updated successfully, but these errors were encountered: