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

Screen Reader reads password in Password TextField

    XMLWordPrintable

Details

    • Android, Windows
    • 57c6168d0 (dev), 140adbe8b (6.7), 4842b83a2 (tqtc/lts-6.5)
    • Multimedia Wk7

    Description

      Summary:
      When a password TextField is focused, the Screen Reader reads the plain text password instead of the masked characters. (Another bug is that Accessible.name for such a field is never read.)

      Repro:
      1. Create a password TextField in QML as follows and add another control, like a RadioButton.

      TextField {
          id: passwordField

          Accessible.name: "Enter Password"
          Accessible.passwordEdit: true
          Accessible.role: Accessible.EditableText

          echoMode: TextInput.Password
          height: 50
          width: 200
      }

      RadioButton {
          checked: true
          text: qsTr("First")
      }

      2. Start a Screen Reader on Windows (Narrator) or Android (Talkback).

      3. Enter text into the password field. On Windows, the screen reader will say 'Hidden' as expected, and the text in the field is masked as expected.

      4. Tab out of the password field to other controls and tab back to the password field. Note that the screen reader reads the plain text password in the field on focus.

      Expected:
      The screen reader should not read the plain text password when the password field is focused. Instead, it should either read nothing or it should read the mask characters, as is the case in other frameworks.

      Bug Details:
      The cause of the bug on Windows is that the Value pattern for this text field is returning the plain text as the value, so the screen reader will read it. See the following source code that shows this. The fix is for this code to return masked characters if echoMode= TextInput.Password. Otherwise, a screen reader or any other accessibility client will be able to read the plain text password.

      qtdeclarative\src\quick\accessible\qaccessiblequickitem.cpp
      QString QAccessibleQuickItem::text(QAccessible::Text textType) const
      {
           :

          // the following block handles item-specific behavior
          if (role() == QAccessible::EditableText) {
              if (textType == QAccessible::Value) {
                  :
                  QVariant text = object()->property("text");
                  return text.toString();

       

      Attachments

        Issue Links

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

          Activity

            People

              padubsky Pavel Dubsky
              vinocher V V
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes