-
Notifications
You must be signed in to change notification settings - Fork 63
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/_preview/2185 Please note that GitHub pages takes a little time to deploy newly pushed code, if the links above don't work or you see old versions, wait 5 minutes and try again. You can check the GitHub pages deployment action list to see the current status of the deployments. |
Size Change: -2.21 kB (0%) Total Size: 879 kB
ℹ️ View Unchanged
|
ac11cfe
to
cb94d7c
Compare
@obulat how did you generate the tab-order image? Can you also share what the tab-order looks like for RTL languages? |
cb94d7c
to
e0004e3
Compare
@dhruvkb it's a firefox feature! |
Whoa, that's awesome! In all this time of using Firefox, I never knew about this. |
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.
This is a good way to avoid the need to control focus with JS. Appreciate all the code that we could delete.
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.
Really great!
Fixes
Fixes #2125 by @obulat
Fixes #2182 by @obulat
Description
This PR moves the sidebar in the DOM order to the position right after the header. Then, using CSS grid, the visual order is changed back to "sidebar on the right". This way, the focus order for keyboard users and for screenreader users is Header -> Filters sidebar -> Main -> Footer.
Normally, using CSS to change the DOM order is bad, but in the case of the search page layout, this actually converts the DOM order into the expected one.
Previously, we used code to manually handle focus after "Tab"/"Shift+Tab" presses on "Filters" button and the last tabbable element in the sidebar and
main
content. However, this only worked for the keyboard navigation, and not the screenreader navigation.This PR allows us to remove the manual focus management code.
Changes in the tabbing order
Before
After LTR
After RTL
Testing Instructions
Open the search page. Move focus using your keyboard "Tab" key: after the Filters
Checklist
Update index.md
).main
) ora parent feature branch.
errors.
Developer Certificate of Origin
Developer Certificate of Origin