Skip to content

Accessibility fix for facet more-less buttons - #5600

Open
ckaz wants to merge 4 commits into
vufind-org:devfrom
finc:pull-request_accessibility-fix-for-more-less-button
Open

Accessibility fix for facet more-less buttons#5600
ckaz wants to merge 4 commits into
vufind-org:devfrom
finc:pull-request_accessibility-fix-for-more-less-button

Conversation

@ckaz

@ckaz ckaz commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

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.

@demiankatz
demiankatz force-pushed the pull-request_accessibility-fix-for-more-less-button branch from 165b170 to c5eef6c Compare August 31, 2026 18:33
@demiankatz

Copy link
Copy Markdown
Member

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 EreMaijala left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@ckaz
ckaz force-pushed the pull-request_accessibility-fix-for-more-less-button branch from c5eef6c to d5c0228 Compare September 1, 2026 10:06
@ckaz

ckaz commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

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.

Many thanks, yes, you are absolutely right -- I missed the effect of this on the screen reader when testing yesterday.
Since the focus got placed on the li element the content of that first new element was announced twice, when users tabbed on, using the right arrow. In this case, the entire element contents got read incl. the exclude button and upon tabbing on (right arrow), the facet value got read and then the exclude button hint text.

I'll re-submit.

@ckaz
ckaz requested a review from EreMaijala September 1, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants