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

[Android] Text inputs are unreliable on Android and trigger invalid onTextChanged events

XMLWordPrintable

    • Android

      import QtQuick 2.7
      import QtQuick.Controls 2.0
      
      ApplicationWindow {
        visible: true
        width: 320
        height: 640
      
        Column {
          width: 200
          //TextField {
          TextInput {
            width: parent.width
            height: 100
            text: 'def'
            onTextChanged: console.log(text)
            id: te
          }
          Text {
            text: te.text
          }
          Text {
            text: "Try appending 'ghi' and prepending 'abc', see what appears"
          }
        }
      }
      

      Not sure if this is a regression or not. I do not remember observing this previously, but I might have avoided this exact usecase.

      On Android, if you use the onscreen keyboard then while the keyboard is open, `text` is set to an empty string and triggers the corresponding event/bindings.

      In Android emulator, if you use hardware keyboard (there are those on Android), the text is set to gibberish, i.e. to the part of the text that was currently entered. Also, the in the text input the text entered from the hardware keyboard is inserted into a wrong position.

      This affects both QtQuick TextField and QtQuick.Controls 2 TextInput.

      Desktop works fine, iOS works fine.

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

            srutledg Shawn Rutledge
            chalker Сковорода Никита
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes