UX: Always disable create account button when user fields are invalid
Previously the button would never be disabled when an external authenticator was being used. The validation error would only appear after submit
This commit is contained in:
parent
252989e261
commit
bc1977ef93
|
@ -69,13 +69,13 @@ export default Controller.extend(
|
|||
"formSubmitted"
|
||||
)
|
||||
submitDisabled() {
|
||||
if (!this.get("emailValidation.failed") && !this.passwordRequired)
|
||||
return false; // 3rd party auth
|
||||
if (this.formSubmitted) return true;
|
||||
if (this.get("nameValidation.failed")) return true;
|
||||
if (this.get("emailValidation.failed")) return true;
|
||||
if (this.get("usernameValidation.failed")) return true;
|
||||
if (this.get("passwordValidation.failed")) return true;
|
||||
if (this.get("usernameValidation.failed") && this.usernameRequired)
|
||||
return true;
|
||||
if (this.get("passwordValidation.failed") && this.passwordRequired)
|
||||
return true;
|
||||
if (this.get("userFieldsValidation.failed")) return true;
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in New Issue