diff --git a/src/components/forms/passwd/index.tsx b/src/components/forms/passwd/index.tsx index a5d2958..6caf7f3 100644 --- a/src/components/forms/passwd/index.tsx +++ b/src/components/forms/passwd/index.tsx @@ -8,6 +8,8 @@ type PasswdProps = JSX.IntrinsicElements["input"] & { locked?: boolean; /** This is optional in case an onChange override is necessary... */ setValue?: React.Dispatch>; + /** Whether to ignore password managers */ + ignorePasswordManager?: boolean; }; type PasswdRef = HTMLInputElement; @@ -22,16 +24,27 @@ export const Passwd = forwardRef( setValue, placeholder, locked = false, + ignorePasswordManager = true, ...restProps }: PasswdProps, ref, ) => { const [reveal, setReveal] = useState(false); + // Create object with conditional password manager attributes + const passwordManagerAttributes = ignorePasswordManager + ? { + "data-lpignore": "true", + "data-1p-ignore": "", + "data-form-type": "other", + "data-bwignore": "", + } + : {}; + return (
( } }} {...restProps} + {...passwordManagerAttributes} /> {!locked && (