PasswordField: Don't show password on enter #37444

This commit is contained in:
Tobias Skarhed 2021-08-02 12:58:00 +02:00 committed by GitHub
parent 73d36d5521
commit b0dcbd568a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,11 +27,12 @@ export const PasswordField: FC<Props> = React.forwardRef<HTMLInputElement, Props
suffix={
<IconButton
name={showPassword ? 'eye-slash' : 'eye'}
surface="header"
type="button"
aria-controls={id}
aria-expanded={showPassword}
onClick={(e) => {
e.preventDefault();
aria-role="switch"
aria-checked={showPassword}
aria-label="Show password"
onClick={() => {
setShowPassword(!showPassword);
}}
/>