Skip to content

A platform for community discussion. Free, open, simple.

UX: Always disable create account button when user fields are invalid

David Taylorbc1977ef93ef
diff --git a/app/assets/javascripts/discourse/controllers/create-account.js.es6 b/app/assets/javascripts/discourse/controllers/create-account.js.es6
index 84b3171cd65..9e7c03d121b 100644
--- a/app/assets/javascripts/discourse/controllers/create-account.js.es6
+++ b/app/assets/javascripts/discourse/controllers/create-account.js.es6
@@ -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;