@@ -187,8 +187,8 @@ Rectangle {
187187 unlockedCheckBox.checked = false
188188 LightDM.Greeter.authenticate(data.username)
189189
190+ var inputField = findChild(lockscreen, "pinentryField")
190191 if (data.alphanumeric) {
191− var inputField = findChild(lockscreen, "pinentryField")
192192 mouseClick(inputField, units.gu(1), units.gu(1))
193193 typeString(data.password)
194194 keyClick(Qt.Key_Enter)
@@ -200,6 +200,12 @@ Rectangle {
200200 }
201201 }
202202 tryCompare(unlockedCheckBox, "checked", data.unlockedSignal)
203+ if (!data.unlockedSignal) {
204+ // make sure the input is cleared on wrong input
205+ tryCompareFunction(function() {return inputField.text.length == 0}, true)
206+ } else {
207+ tryCompareFunction(function() {return inputField.text.length > 0}, true)
208+ }
203209 }
204210 }
205211}