PasswordField: Don't show password on enter #37444 (#37448)

(cherry picked from commit b0dcbd568a)

Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)andTobias Skarhed authored and GitHub committed 2021-08-02 14:09:38 +02:00
1 parent fc5e1dbd15
commit 1d12f22190
1 file changed
+5 -4
@@ -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);
}}
/>