Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25858

Screen readers list an unnamed field next to each suggest picker

    XMLWordPrintable

Details

    • Unknown

    Description

      Steps to reproduce

      1. Edit a page with the WYSIWYG editor and insert the Include macro.
      2. Look at the accessibility tree of the macro dialog (e.g. in the Accessibility pane of the browser's developer tools), or run axe on it.

      Actual result

      Right before the "Page" picker (a combobox named "Page"), the accessibility tree lists an unnamed textbox: the original input#parameter-reference that Tom Select took over. axe reports a critical label violation on it. Screen reader users meet an extra field, with no name and no visible counterpart, next to the picker.

      group
        LabelText "Page"
        StaticText "The reference of the page to include."
        textbox
        combobox "Page"
      

      Expected result

      Only the picker is exposed, as before 18.2.0, when Selectize hid the original field with display: none.

      Cause

      Since XWIKI-24088 (18.2.0), Tom Select hides the original select / input of a suggest picker with its ts-hidden-accessible class, which only clips it visually (same cause as XWIKI-25234). The field gets tabindex="-1" but no aria-hidden, and its label now points to the Tom Select control, so assistive technologies list it as an unnamed field. Every suggest picker enhanced by Tom Select gets that class, e.g. the select of the Username parameter of the User Avatar macro (see XWIKI-25234).

      Upstream, orchidjs/tom-select#997 (the hidden field has no label) was closed with a workaround, not with a fix in the library.

      Suggested fix

      Set aria-hidden="true" on the original field once Tom Select has taken it over, and remove it if the picker is destroyed. Doing so in a macro dialog leaves only the pickers in the accessibility tree, with no axe violation.

      Environment

      Observed on XWiki 18.9.0 with Chrome.

      PS: This post was co-written with Claude Code.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              vmassol Vincent Massol
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: