do not override passed style
This commit is contained in:
parent
4d8f85508a
commit
49caec5b63
@ -1188,12 +1188,18 @@ export function PasswordInput ({ newPass, qr, copy, readOnly, append, value, ...
|
|||||||
)
|
)
|
||||||
}, [showPass, copy, field?.value, qr, readOnly, append])
|
}, [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 (
|
return (
|
||||||
<ClientInput
|
<ClientInput
|
||||||
{...props}
|
{...props}
|
||||||
{
|
style={style}
|
||||||
...(!showPass && props.as === 'textarea') ? { style: { '-webkit-text-security': 'disc' } } : {}
|
|
||||||
}
|
|
||||||
className={styles.passwordInput}
|
className={styles.passwordInput}
|
||||||
type={showPass ? 'text' : 'password'}
|
type={showPass ? 'text' : 'password'}
|
||||||
autoComplete={newPass ? 'new-password' : 'current-password'}
|
autoComplete={newPass ? 'new-password' : 'current-password'}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user