-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix gallery tab order #15540
Fix gallery tab order #15540
Conversation
- Reorder: img goes first than the inline menu items - Always render the inline menu items. We want to keep a consistent tabbable experience. We'll style them down when not in focus.
We can't use the isSelected property to conditionally render them, otherwise they won't be tabbed through when tabbing backwards.
The GalleryImage gets selected by focusing on the caption (tabbing backwards) and the <img> element (tabbing forwards). At that time, the button is enabled, and will get the focus.
Note that the caption's toolbar is part of the tab stops when tabbing backward but not forward. Making it work identical for both cases would require the caption's toolbar to always be visible for the selected GalleryImage, not only when the caption is selected. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are still inconsistencies related to the toolbar but this is a huge improvement over what we have.
Fixes: #14814
Previous attempt: #14931
This PR fixes the keyboard tab order for navigating through gallery items:
Forward:
Backward:
There is a related issue #14823 for deselecting the image when it is the first/last after it losses focus. This will be fixed separately.