Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/password-a11y.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@rocket.chat/fuselage': patch
'@rocket.chat/fuselage-forms': patch
---

Fix PasswordInput a11y violations by adding ARIA attributes to the toggle icon.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { forwardRef } from 'react';
import { Icon } from '../Icon';
import { InputBox, type InputBoxProps } from '../InputBox';

// TODO: fix a11y issues


export type PasswordInputProps = Omit<InputBoxProps, 'type'>;

Expand All @@ -23,6 +23,10 @@ const PasswordInput = forwardRef<HTMLInputElement, PasswordInputProps>(
name={hidden ? 'eye-off' : 'eye'}
size={20}
onClick={handleAddonClick}
role="button"
tabIndex={0}
aria-label={hidden ? "Show password" : "Hide password"}
onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); handleAddonClick(); } }}
/>
}
ref={ref}
Expand Down