-
Notifications
You must be signed in to change notification settings - Fork 292
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
Better focus management for a11y #259
Comments
I agree. PR anyone? |
For focus management, here's what I've coded in the
How does that sound, @mrwweb ? |
Sounds about right! I appreciate the quick response to these issues. Hope they can benefit everyone. |
Cool. Published |
Maybe I'm missing something, but this change seems to make it impossible to focus on the close button while using the keyboard. |
Similarly, it also doesn't seem possible to focus on the next/prev buttons in the gallery when one is active and I guess those spans should probably also be updated to use button elements. |
Mmm, you're right, the close button has a |
Fixed and released. |
Sorry to keep hounding on this issue, but while the internal focus management seems improved in When the normal content is brought back into focus, the element in focus when the lightbox was triggered should regain focus. Right now, when the lightbox closes focus returns to the beginning of the page and the user is forced to tab back through the navigation and content rather than continuing where they left off. |
Yup. That was one of the primary points of the original ticket. Thanks, @robneu! |
This example has a couple weird things going on, but the focus management seems about right: http://fnagel.github.io/jQuery-Accessible-RIA/Lightbox/ |
Mmm, it's possible that it focusses on the first item, my test has only one item! Let me check |
What kind of issue is this? (put 'x' between the square brackets)
[X ] Bug report. If you’ve found a bug, you must provide a minimal example in a CodePen,
starting from http://jsfiddle.net/JNsu6/15/ .
[X ] Feature Request. Make sure there's no good way to do what you want first;
consider asking on http://stackoverflow.com/questions/ask first.
This is half-feature-request-half-bug since bad focus management is really bad for accessibility. As detailed in "Learning to focus()", when users toggle open the lightbox, the keyboard focus should be shifted to/inside the modal. Just as importantly, focus should be returned to the element that triggered the lightbox when it's closed.
Yes, this could be implemented with custom functions and the available events provided by featherlight (as in #151), but there's no reason why it shouldn't be baked in. I could even imagine a shiftFocusTo argument with a select for specifying the best element in the lightbox to receive focus (form field, close button, etc.)
See also: "Managing focus for modal dialogs"
The text was updated successfully, but these errors were encountered: