passwords: Add keyboard accessibility for show/hide password icons.

Tweaked by tabbott to add the required tabindex configuration in the
password reset, password change, and registration forms as well.
This commit is contained in:
abdelrahman725
2024-03-01 01:29:45 +00:00
committed by Tim Abbott
parent a43e9140f2
commit b0a4b8e439
6 changed files with 33 additions and 12 deletions

View File

@@ -172,4 +172,11 @@ export function setup_password_visibility_toggle(
e.stopPropagation();
toggle_password_visibility(password_field_id, password_selector, tippy_tooltips);
});
$(password_selector).on("keydown", (e) => {
if (e.key === "Enter") {
e.preventDefault();
e.stopPropagation();
toggle_password_visibility(password_field_id, password_selector, tippy_tooltips);
}
});
}