Skip to content

fix(lxlweb): a11y FS10, NL30 (correct forms) - #1700

Merged
jesperengstrom merged 7 commits into
developfrom
fix-lxlweb-a11y-fs10
Oct 9, 2026
Merged

jesperengstrom merged 7 commits into
developfrom
fix-lxlweb-a11y-fs10

Conversation

@jesperengstrom

@jesperengstrom jesperengstrom commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

Solves

  • Report no: FS10, NL30

Use correct forms and form controls

The report mainly focuses on supersearch, but also points out a number of issues regarding the filter panel:

  • What looks like form elements (checkboxes, radio buttons) are actually links with icons
  • They cannot be interacted with using space and arrow keys as expected
  • Overuse of screen reader labels for these links mismatch the visible text and create too much repetition
  • Interacting with the links causes navigation and loss of focus

I've replaced the 'form simulation links' with two new components, FacetRadio and FacetCheckbox which uses real form elements including fieldset, legend and label. To do this completely by the book, we should also have a 'submit' button. But there's a technical limitation to this: the frontend cannot compute the resulting query from multiple choices made; we must use the view.@id for each. Which means navigation has to happen onChange, which makes them JS dependent.

Apart from this tradeoff, this seems to work pretty well. Svelte's keep-focus and no-scroll options manages to update the results while keeping focus. A small debouncer prevents too many navigations to occur while moving through radio buttons. In the case of a completely server-rendered page (no JS), the FacetLinks are rendered instead.

Pros:

  • Retaining focus also helps to preserve filter panel state. Disorientation caused by content scrolling/collapsing on navigation is now less evident.

Drawbacks:

  • A radio button cannot be unchecked. Filters chosen from such a category has to be removed from the search field.
radio-1

Summary of changes

  • Rename component FacetGroup -> Facet
  • Rename component FacetValue -> FacetLink
  • Extract logic to new component FacetLinks
  • Create FacetRadio and FacetCheckbox components
  • Remove screen reader labels ('klicka för att lägga till filter' etc)
  • Fix tests

@jesperengstrom
jesperengstrom marked this pull request as ready for review October 7, 2026 09:44
@jesperengstrom jesperengstrom changed the title fix(lxlweb): a11y FS10 (correct forms) fix(lxlweb): a11y FS10, NL30 (correct forms) Oct 7, 2026

@olovy olovy 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.

LGTM!

My only comment is that the radio button labels don't span the full width of the facet panel. The hover highlight is for the full width but only the text can be clicked.
For links and checkboxes the full width is clickable.

@olovy

olovy commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

As I understand it, it is best practice to not change the pointer for checkboxes and radio buttons. But it feels a bit spretigt with mixed hand and regular pointer in the facet panel.

@jesperengstrom

Copy link
Copy Markdown
Contributor Author

radio button labels don't span the full width of the facet panel.

fixed in 3cd9e4e

But it feels a bit spretigt

Agreed, but as you say it's default behaviour and I don't think we should tamper with it

@jesperengstrom
jesperengstrom merged commit c9db9d9 into develop Oct 9, 2026
2 checks passed
@jesperengstrom
jesperengstrom deleted the fix-lxlweb-a11y-fs10 branch October 9, 2026 14:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants