Accessibility fix for facet more-less buttons - #5600
Conversation
165b170 to
c5eef6c
Compare
|
Thanks, @ckaz! The build was failing here because the compiled CSS needed to be committed. I've gone ahead and added that to the PR to get things passing. I'll defer to @crhallberg and @EreMaijala on the actual review of the changes, as they may have more insightful comments than me due to better familiarity with the existing truncation library and/or best front-end practices. I'm happy to give this another technical review after one or both of them have chimed in, but I'm going to let somebody else make the first move. ;-) |
EreMaijala
left a comment
There was a problem hiding this comment.
I may be mistaken, but I don't think this works quite as it should. When the code focuses the first revealed element, there's a fair chance that it's one outside the normal tab order or list of focusable elements. In this case you'd normally move from facet link to link, but now the code focuses the li element that doesn't normally receive focus.
c5eef6c to
d5c0228
Compare
Many thanks, yes, you are absolutely right -- I missed the effect of this on the screen reader when testing yesterday. I'll re-submit. |
When using the more button in the facets sidebar, the focus remains on the more button so that screen reader users would have to navigate backwards to read the newly revealed content. This PR attempts to solve this by moving the focus to the first element newly revealed. In addition, the button had no focus highlighting which was added as well.
This behavior was requested by our accessibility testing company.
I used Claude Code to help with the JS. Tested locally in our docker environment.