Skip to content

Commit

Permalink
Merge branch 'master' into walletref
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardobl authored Nov 6, 2024
2 parents e4fa21f + 281757d commit 7a3a6d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions components/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -1188,17 +1188,24 @@ export function PasswordInput ({ newPass, qr, copy, readOnly, append, value, ...
)
}, [showPass, copy, field?.value, qr, readOnly, append])

const maskedValue = !showPass && props.as === 'textarea' ? field?.value?.replace(/./g, '•') : field?.value

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}
style={style}
className={styles.passwordInput}
type={showPass ? 'text' : 'password'}
autoComplete={newPass ? 'new-password' : 'current-password'}
readOnly={readOnly}
append={props.as === 'textarea' ? undefined : Append}
value={maskedValue}
value={field?.value}
under={props.as === 'textarea'
? (
<div className='mt-2 d-flex justify-content-end' style={{ gap: '8px' }}>
Expand Down

0 comments on commit 7a3a6d6

Please sign in to comment.