I have this small component that is in a popup this apptexfield is to capture a sms code:
InputField {
id: tfSMSCode
property bool valid: tfSMSCode.text.length === 6
width: parent.width
placeholderText: qsTr("_ _ _ _ _ _")
anchors.horizontalCenter: parent.horizontalCenter
font.pixelSize: sp(15)
font.bold: true
horizontalAlignment: Text.AlignHCenter
validator: RegExpValidator {
regExp: /^\d{1,6}$/
}
}
YellowButton {
id: btnVerifySMSCode
minimumWidth: parent.width
minimumHeight: dp(50)
text: qsTr("Verificar")
enabled: tfSMSCode.valid
anchors.horizontalCenter: parent.horizontalCenter
onClicked: {
btnVerifyClicked(tfSMSCode.text)
close()
}
}
the problem is that on some android devices the property ‘property bool valid: tfSMSCode.text.length === 6' is not working, unless the
user ‘move’ manually the cursor on the input code on textfield to the start:
from:
12345 6
to
1 23456
is this qml bug? and why does happen only on some devices, I will add some screenshots that my tester has pass me.
https://www.dropbox.com/s/i6ygpbi8df883ew/disabled.png?dl=0
https://www.dropbox.com/s/ltf7cnme9nfizy8/enabled.png?dl=0
This is givin the impression that the app is not working since you can’t do anything as you input the sms code but the button isn’t setting the enable property to true