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

TextInput on Android has no current word in "text" property until the whole word is committed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P4: Low
    • None
    • 5.5.1, 5.6.0 Alpha
    • QPA
    • None
    • Android 4.4
    • Android

    Description

      When I edit text in TextField on Android, text property not updated properly before the whole word not typed. This is only happen if I enable correction suggestion (predicative text) in keyboard settings. During typing word, only displayText is updated. The current typing word is underlined and I see this word in the list of variants for correction on top of the keyboard (see attached screenshot). If I either press on this word in the list or type space, the text property will update.

      Program to reproduce:

      import QtQuick 2.5
      import QtQuick.Window 2.2
      
      Window {
          visible: true
      
          Rectangle {
              height: 60
              width: 200
              border {
                  width: 1
                  color: "black"
              }
              anchors.centerIn: parent
      
              TextInput {
                  function logTexts() {
                      console.log("text: '%1'".arg(text), "displayText: '%1'".arg(displayText))
                  }
      
                  text: "Test"
                  anchors.fill: parent
      
                  horizontalAlignment: TextInput.AlignHCenter
                  verticalAlignment: TextInput.AlignVCenter
      
                  Component.onCompleted: logTexts()
                  onTextChanged: logTexts()
                  onDisplayTextChanged: logTexts()
                  onAccepted: logTexts()
                  onEditingFinished: logTexts()
              }
          }
      }
      

      At the time screenshot been made, the output of properties was:

      text: 'Test ' displayText: 'Test test111'

      Attachments

        1. word_typing.png
          55 kB
          Nikita Krupenko
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rampe Rami Potinkara
            krnekit Nikita Krupenko
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes