-
Notifications
You must be signed in to change notification settings - Fork 64
Tab order #1394
Conversation
Storybook and Tailwind configuration previews: Ready Storybook: https://wordpress.github.io/openverse-frontend/1394 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: +1.59 kB (0%) Total Size: 1.4 MB
ℹ️ View Unchanged
|
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 working great already! Nice work, glad to get this a11y issue resolved 🎉
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 such a big improvement and tests very well locally.
There's one last quirk but I'm not sure how to address it or if it needs to be addressed. IF you have the filter sidebar open and tab over to the results, then shift tab back up, you never reach the filter sidebar, instead you jump straight to the header and have to tab to the filter button and then tab into the filter sidebar.
I'm not sure whether this needs to be changed, but it might be more contextually confusing if you remembered that the order went "filter button -> filter options -> results" but then going backwards the filter options are skipped. In fact, it might lead you to assume the filter options were closed and then have a moment of confusion when you land on the filter button again and find that it's still reporting itself as pressed.
But that's just a guess. I'm not sure if that's what users would expect or not.
Co-authored-by: sarayourfriend <[email protected]>
I was afraid that I missed one of the scenarios. Thank you for describing it! |
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 working great! At first I was surprised with the functionality, expecting that pressing enter on the filter button would then shift focus to the first filter, and that tabbing from the button would continue through the regular document flow into the results themselves, but the behavior here is consistient with google search and Pexels, both which have fairly similar filter UIs.
Fixes
Fixes #989 by @zackkrida
Description
This PR automatically focuses the filters sidebar when the user presses Tab key when the Filters button is pressed.
I will also add automatic focusing of the sidebar when the button is clicked.Do we really need this? I think to add it, we would need to do something likeVue.nextTick
, because when you click the filters button, the sidebar is not yet rendered.When the user presses Tab key when on the last focusable item on the sidebar, the focus moves to the first focusable element in the
main
element. When the user pressed ShiftTab on the first focusable element in the sidebar (whether it's a checkbox or the 'Clear filters' button), the focus goes to the Filters button.Also, when the user presses Tab on the last focusable element in the main search page (one of the Meta Search buttons, or the scroll to top button), the focus moves to the first focusable element in the layout instead of moving to the filters sidebar again.
Testing Instructions
Open the app on desktop. Try Tabbing from the Filters button, and tabbing through the filters sidebar to the main element. Try All content, Image and Audio views.
Checklist
Update index.md
).main
) or a parent feature branch.Developer Certificate of Origin
Developer Certificate of Origin