fix(@desktop/onboard): don't submit password creation form on enter when invalid
There's a bug where creating a password is possible while having an invalid state because hitting enter causes the submission without checking the form's validity. This commit fixes it by only submitting the form when both fields are actually valid. Closes #3412
This commit is contained in:
parent
8f9c46bfef
commit
3536b57e08
|
@ -50,8 +50,10 @@ ModalPopup {
|
||||||
placeholderText: qsTrId("confirm-password…")
|
placeholderText: qsTrId("confirm-password…")
|
||||||
textField.echoMode: TextInput.Password
|
textField.echoMode: TextInput.Password
|
||||||
Keys.onReturnPressed: function(event) {
|
Keys.onReturnPressed: function(event) {
|
||||||
|
if (submitBtn.enabled) {
|
||||||
submitBtn.clicked(event)
|
submitBtn.clicked(event)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
onTextChanged: {
|
onTextChanged: {
|
||||||
[repeatPasswordFieldValid, repeatPasswordValidationError] =
|
[repeatPasswordFieldValid, repeatPasswordValidationError] =
|
||||||
Utils.validatePasswords("repeat", firstPasswordField, repeatPasswordField);
|
Utils.validatePasswords("repeat", firstPasswordField, repeatPasswordField);
|
||||||
|
|
Loading…
Reference in New Issue