From 1d12f221903da67dfd2cc167d81b8ef397d4295a Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 2 Aug 2021 13:09:38 +0100 Subject: [PATCH] PasswordField: Don't show password on enter #37444 (#37448) (cherry picked from commit b0dcbd568afd443abd7320af25a6dfc9bb70aba1) Co-authored-by: Tobias Skarhed <1438972+tskarhed@users.noreply.github.com> --- .../app/core/components/PasswordField/PasswordField.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/public/app/core/components/PasswordField/PasswordField.tsx b/public/app/core/components/PasswordField/PasswordField.tsx index fcf8dad7729..3ba84eb1ba4 100644 --- a/public/app/core/components/PasswordField/PasswordField.tsx +++ b/public/app/core/components/PasswordField/PasswordField.tsx @@ -27,11 +27,12 @@ export const PasswordField: FC = React.forwardRef { - e.preventDefault(); + aria-role="switch" + aria-checked={showPassword} + aria-label="Show password" + onClick={() => { setShowPassword(!showPassword); }} />