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:
Pascal Precht 2021-09-08 15:28:23 +02:00 committed by Iuri Matias
parent 8f9c46bfef
commit 3536b57e08
1 changed files with 3 additions and 1 deletions

View File

@ -50,7 +50,9 @@ ModalPopup {
placeholderText: qsTrId("confirm-password…")
textField.echoMode: TextInput.Password
Keys.onReturnPressed: function(event) {
submitBtn.clicked(event)
if (submitBtn.enabled) {
submitBtn.clicked(event)
}
}
onTextChanged: {
[repeatPasswordFieldValid, repeatPasswordValidationError] =