Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-134208

Mnemonic annotation is passed to screen readers

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      import QtQuick
      import QtQuick.Controls.Fusion
      
      Button {
          text: "Mnem&onic"
      }
      

      When run using qml, the above snippet will display a button with the label "Mnem+o+nic". When the Button is focused, however, what is actually read out by screen readers like orca is not "Mnemonic" but "Mnem-and-onic".

      This breaks the match between default visual and auditory presentation.

      It is also not how Browsers behave for assigning default Accessible names in cases of strings containing markup:

      <html>
      <button type="button"><p>Mnem<span style="text-decoration: underline;">o</span>nic</p></button>
      </html>

      is read out as simply "Mnemonic" (Tested using Firefox and Orca on Fedora 41).

      This is consistent with the ARIA specifications for Accessible names, which are suppossed to be flat strings that "[do] not contain any markup".

      The Mnemonic markup character should not be sent to screen readers, but removed from the label. This could be done by changing the default Accessible.name computation, or by removing markup from the qml Accessible.name property before passing it to screen readers. (The first may break unit tests that reference elements by their name according to the existing computation, and the second introduces a discrepancy between the qml property and the accessibility tree property).

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cwo Christoph Wolk
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes