diff --git a/docs/components/password-reveal.md b/docs/components/password-reveal.md index 11abe9f3..6b6895d8 100644 --- a/docs/components/password-reveal.md +++ b/docs/components/password-reveal.md @@ -9,4 +9,6 @@ title: Password reveal ## When to use -Use the password reveal component to let users check their password safely. \ No newline at end of file +Use the password reveal component to let users check their password safely. + +This component automatically sets the `spellcheck` attribute to `false` to prevent users' passwords being stored in their browsers. diff --git a/src/moj/components/password-reveal/password-reveal.js b/src/moj/components/password-reveal/password-reveal.js index 8f6a3751..d1f4440f 100644 --- a/src/moj/components/password-reveal/password-reveal.js +++ b/src/moj/components/password-reveal/password-reveal.js @@ -7,6 +7,7 @@ MOJFrontend.PasswordReveal = function(element) { } $el.data('moj-password-reveal-initialised', true); + $el.attr('spellcheck', 'false'); $el.wrap('
'); this.container = $(this.el).parent();