fix(@desktop/onboarding): Clearing error message when password confirmation is empty

Fix #5319
This commit is contained in:
Michal Iskierko 2022-05-11 13:33:07 +02:00 committed by Michał Iskierko
parent 0bb594d05f
commit 146ff7a48b
1 changed files with 11 additions and 1 deletions

View File

@ -49,6 +49,11 @@ Column {
}
function checkPasswordMatches(onlyIfConfirmPasswordHasFocus = true) {
if (confirmPswInput.textField.text.length === 0) {
errorTxt.text = ""
return
}
if (onlyIfConfirmPasswordHasFocus && !confirmPswInput.textField.focus) {
return
}
@ -301,7 +306,12 @@ Column {
keepHeight: true
textField.rightPadding: showHideConfirmIcon.width + showHideConfirmIcon.anchors.rightMargin + Style.current.padding / 2
onTextChanged: { if(textField.text.length === newPswInput.text.length) root.checkPasswordMatches() }
onTextChanged: {
if(textField.text.length === newPswInput.text.length || textField.text.length === 0) {
root.checkPasswordMatches()
}
}
textField.onFocusChanged: {
// When clicking into the confirmation input, validate if new password:
if(textField.focus) {