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 49caec5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,12 +1188,18 @@ export function PasswordInput ({ newPass, qr, copy, readOnly, append, value, ...
)
}, [showPass, copy, field?.value, qr, readOnly, append])

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

0 comments on commit 49caec5

Please sign in to comment.