@@ -33,6 +33,7 @@ Item {
3333
3434 function clear(playAnimation) {
3535 pinentryField.text = "";
36+ pinentryField.incorrectOverride = false;
3637 pinentryField.forceActiveFocus();
3738 if (playAnimation) {
3839 wrongPasswordAnimation.start();
@@ -62,6 +63,9 @@ Item {
6263 TextInput {
6364 id: pinentryField
6465 objectName: "pinentryField"
66+
67+ property bool incorrectOverride: false
68+
6569 anchors {
6670 top: parent.top
6771 left: parent.left
@@ -86,6 +90,11 @@ Item {
8690 enabled: root.entryEnabled
8791 clip: true
8892
93+ onTextChanged: incorrectOverride = true
94+
95+ onActiveFocusChanged: if (!activeFocus) pinentryField.forceActiveFocus()
96+ onEnabledChanged: if (enabled) pinentryField.forceActiveFocus()
97+
8998 onAccepted: {
9099 if (pinentryField.text) {
91100 root.entered(pinentryField.text);
@@ -101,7 +110,7 @@ Item {
101110 anchors.horizontalCenter: parent.horizontalCenter
102111 horizontalAlignment: Text.AlignHCenter
103112 text: root.errorText
104− visible: pinentryField.text.length == 0
113+ visible: pinentryField.text.length == 0 && !pinentryField.incorrectOverride
105114 }
106115 }
107116 }