Skip to content

Commit

Permalink
feat: add autocomplete attribute to login-form password field (#2847)
Browse files Browse the repository at this point in the history
  • Loading branch information
hdamr authored Oct 13, 2021
1 parent 45b745a commit 489fa59
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/login/src/vaadin-login-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class LoginForm extends LoginMixin(ElementMixin(ThemableMixin(PolymerElement)))
required
on-keydown="_handleInputKeydown"
spellcheck="false"
autocomplete="current-password"
>
<input type="password" slot="input" on-keyup="_handleInputKeyup" />
</vaadin-password-field>
Expand Down
5 changes: 5 additions & 0 deletions packages/login/test/login-form.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,11 @@ describe('login form', () => {
const usernameElement = login.$.vaadinLoginUsername;
expect(document.activeElement).to.equal(usernameElement.inputElement);
});

it('should have autocomplete attribute set', () => {
const passwordField = login.$.vaadinLoginPassword;
expect(passwordField.getAttribute('autocomplete')).to.be.equal('current-password');
});
});

describe('no forgot password', () => {
Expand Down

0 comments on commit 489fa59

Please sign in to comment.