Skip to content

Commit

Permalink
do not override passed style
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl committed Nov 5, 2024
1 parent 4d8f855 commit 2b9277a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,12 +1188,17 @@ export function PasswordInput ({ newPass, qr, copy, readOnly, append, value, ...
)
}, [showPass, copy, field?.value, qr, readOnly, append])

if (props.as === 'textarea') {
if (!showPass) {
if (!props.style) props.style = {}
props.style.WebkitTextSecurity = 'disc'
} else {
if (props.style?.WebkitTextSecurity) delete props.style.WebkitTextSecurity
}
}
return (
<ClientInput
{...props}
{
...(!showPass && props.as === 'textarea') ? { style: { '-webkit-text-security': 'disc' } } : {}
}
className={styles.passwordInput}
type={showPass ? 'text' : 'password'}
autoComplete={newPass ? 'new-password' : 'current-password'}
Expand Down

0 comments on commit 2b9277a

Please sign in to comment.