Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. 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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 17.0.0-rc-1, 16.10.3, 18.9.0
    • Unknown
    • 1.3.1 Info and Relationships

    Description

      Steps to reproduce

      1. Open a page with a suggest picker, e.g. the Page picker of the Include macro dialog (edit a page with the WYSIWYG editor and insert the Include macro).
      2. Type a text, move through the suggestions with the arrow keys, then pick a suggestion other than the last one highlighted, or close the list without picking.
      3. Look at the accessibility tree next to the picker (e.g. in the Accessibility pane of the browser's developer tools), or read the field with a screen reader.

      Actual result

      The live region that the suggest pickers add after their input (a span.sr-only with aria-live="assertive") still holds the text of the last highlighted suggestion, e.g. a page that wasn't picked next to the picked one. Screen readers read it as text next to the field, although it has nothing to do with the field's value.

      Expected result

      The live region is emptied once the list of suggestions closes or a value is picked, so that it only announces the highlighted suggestion while the list is open.

      Cause

      xwiki.selectize.js (the xwiki-selectize module, which wraps Tom Select since XWIKI-24088) overrides setActiveOption to write the text of the active option into liveRegion (added by XWIKI-22492), and nothing clears it afterwards.

      Environment

      Seen on XWiki 18.9.0 with Chrome; the same code is on master.

      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: