Details
-
Bug
-
Resolution: Unresolved
-
Major
-
18.2.0-rc-1, 18.9.0
-
Unknown
-
Description
Steps to reproduce
- Edit a page with the WYSIWYG editor and insert the Include macro.
- 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
- is caused by
-
XWIKI-24088 Replace Selectize with Tom Select
-
- Closed
-
- is related to
-
XWIKI-25898 The live region of the suggest pickers keeps the text of the last highlighted suggestion, which screen readers read next to the picked value
-
- Open
-
- relates to
-
XWIKI-25234 Submitting the macro dialog with an empty required parameter displayed with a suggest picker gives no visible feedback
-
- Closed
-