diff --git a/README.md b/README.md index 2676f6c..65c1b9d 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ For more information on contributing to this repository visit [Contributing to a * *Forgot password microflow* - Microflow being triggered in case of 'forgot password' onclick * *Focus username input field* - Move focus to username field when the form is showed (only use this if it is not done automatically) * *Login Failure Text* - Warning message to show when login fails twice +* *Auto complete* - Enables/disables autocomplete functionality on username and password input field ### Mobile * *Auto capitalize* - Enables/disables auto capitalize functionality on username input field for mobile devices diff --git a/src/LoginForm/LoginForm.xml b/src/LoginForm/LoginForm.xml index fb8b86f..a272712 100644 --- a/src/LoginForm/LoginForm.xml +++ b/src/LoginForm/LoginForm.xml @@ -95,6 +95,11 @@ Behavior When the login fails, clear the username field + + Auto-complete + Behavior + Enables/disables auto-complete functionality on username and pasword input fields + Show/Mask Password Toggle Password diff --git a/src/LoginForm/widget/LoginForm.js b/src/LoginForm/widget/LoginForm.js index 92cab8d..a4f9b39 100644 --- a/src/LoginForm/widget/LoginForm.js +++ b/src/LoginForm/widget/LoginForm.js @@ -74,6 +74,7 @@ define([ dofocus: false, showLoginFailureWarning: false, loginFailureText: "Your account will be blocked for 5 minutes if login with the same username fails thrice!", + autoComplete: false, /** * Password */ @@ -178,6 +179,10 @@ define([ if (this.autoCapitalize && this.convertCase !== "none") { domAttr.set(this.usernameInputNode, "autocapitalize", "on"); } + if (this.autoComplete) { + domAttr.set(this.usernameInputNode, "autocomplete", "on"); + domAttr.set(this.passwordInputNode, "autocomplete", "on"); + } if (this.convertCase === "toLowerCase") { domStyle.set(this.usernameInputNode, "text-transform", "lowercase"); diff --git a/src/LoginForm/widget/templates/LoginForm.html b/src/LoginForm/widget/templates/LoginForm.html index 13ac597..b10cda8 100644 --- a/src/LoginForm/widget/templates/LoginForm.html +++ b/src/LoginForm/widget/templates/LoginForm.html @@ -3,12 +3,12 @@
- +
- +
diff --git a/src/LoginForm/widget/templates/LoginFormWithoutShowPassword.html b/src/LoginForm/widget/templates/LoginFormWithoutShowPassword.html index ac4a295..4457c37 100644 --- a/src/LoginForm/widget/templates/LoginFormWithoutShowPassword.html +++ b/src/LoginForm/widget/templates/LoginFormWithoutShowPassword.html @@ -3,11 +3,11 @@
- +
- +