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

QML TextField copies text from other TextField when echoMode:TextInput.Password or PasswordEchoOnEdit is set on Android 4.1.2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.8.0
    • None
    • Android 4.1.2, Samsung Galaxy S3 Mini

    Description

      When filling in multiple QML TextFields in succession and without dismissing the virtual keyboard, if a TextField with echoMode: TextInput.Password or echoMode: TextInput.PasswordEchoOnEdit is filled after a TextField without either of these echoModes, the text of the previous TextField gets copied into the password TextField before any new characters are filled in.

      For example, imagine two TextFields:

      QML
      TextField {
                      id: emailTextField
                      width: //something
                      x: //something
                      y: //something
                      height: //something
                      font.family: "Trebuchet"
      
                      onAccepted: {
                          if (passwordTextField.text.length > 0 && emailTextField.text.length > 0) {
                              performLoginOperation();
                          }
                      }
      }
      
      
      TextField {
                      id: passwordTextField
                      width: //something
                      x: //something
                      y: //something
                      height: //something
                      echoMode: TextInput.Password
                      font.family: "Trebuchet"
      
                      onAccepted: {
                          if (passwordTextField.text.length > 0 && emailTextField.text.length > 0) {
                              performLoginOperation();
                          }
                      }
      }
      

      Filling in the first works just fine, filling in the second immediately afterwards without a dismissal of the virtual keyboard leads to a copy of the text in the first one into the second one. Typing in "helloworld" into the first one, then selecting the second one and pressing the t button would result in "helloworldt" filled into the second one.

      More specific behaviours:

      • The copy only happens after the first key of the keyboard is pressed, but is set in front of the newly applied character
      • It only happens between non-password field and password field in that specific order - no problem the other way around or between two non-password or two password fields.
      • Dismissing the keyboard between inputs stops the copy from happening
      • If there's text in the password textfield already, the copy is put after the existing text
      • Setting a placeholderText has no effect
      • Changing the echoMode to a not-password related one immediately stops any copies from happening with the exact same other settings.

      This only happens on Android and is even then limited to (a) specific version(s). I could not reproduce the bug on desktop, iOs or Android 5.1.1, however, on the Galaxy S3 Mini running Android 4.1.2 it happens consistently.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            Aerius Nils Dorando
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes