Igor Mironchik
Igor Mironchik

Reputation: 804

Why in QML TextField on Android character replacements are truncated?

I create text field for password input in QML with the following code:

TextField {
    id: pwdField
    placeholderText: qsTr( "Password" )
    leftPadding: appWindow.minimumCtrlHeight / 3
    echoMode: TextInput.Password
    text: connectScreen.pwd
    selectByMouse: true
    mouseSelectionMode: TextInput.SelectCharacters
    implicitHeight: appWindow.minimumCtrlHeight
    implicitWidth: content.width - 40 - implicitHeight - pwdText.width
    verticalAlignment: TextInput.AlignVCenter
}

And the problem is that on Android the character replacement circles are truncated. Look at the picture:

text field

Is it a known bug of Qt 6.3.1? Or maybe I missed something and this can be fixed?

appWindow.minimumCtrlHeight is Screen.pixelDensity * 8

Placeholder text is normal, look:

placeholder

Password in shown mode is ok too:

shown

Upvotes: 0

Views: 111

Answers (1)

Igor Mironchik
Igor Mironchik

Reputation: 804

The problem was in the following line:

implicitHeight: appWindow.minimumCtrlHeight

Dropping this line solved the issue.

Upvotes: 0

Related Questions