Skip to content

Commit

Permalink
Prevent password managers from autofilling the fields
Browse files Browse the repository at this point in the history
(closes #1085)
  • Loading branch information
bhousel committed Aug 31, 2023
1 parent 7f25c26 commit 9c24dc3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,14 @@ export function utilFunctor(value) {
export function utilNoAuto(selection) {
const isText = (selection.size() && selection.node().tagName.toLowerCase() === 'textarea');

// assign 'new-password' even for non-password fields to prevent browsers (Chrome) ignoring 'off'
// https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion

return selection
// assign 'new-password' even for non-password fields to prevent browsers (Chrome) ignoring 'off'
.attr('autocomplete', 'new-password')
.attr('autocorrect', 'off')
.attr('autocapitalize', 'off')
.attr('data-1p-ignore', '') // Rapid#1085
.attr('data-lpignore', 'true') // Rapid#1085
.attr('spellcheck', isText ? 'true' : 'false');
}

0 comments on commit 9c24dc3

Please sign in to comment.