Skip to content

Commit

Permalink
Prevent screen reader from reading dropdown options twice
Browse files Browse the repository at this point in the history
Close #7125

Co-authored-by: bir <[email protected]>
  • Loading branch information
hrb-hub and BijinDev committed Nov 12, 2024
1 parent d10c131 commit 4d25b43
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/gui/base/buttons/RowButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ export class RowButton implements Component<RowButtonAttrs> {
const color = attrs.selected ? theme.content_button_selected : theme.content_button
return m(BaseButton, {
label,
text: m(".plr-button.text-ellipsis", { style: { color } }, text),
text: m(
".plr-button.text-ellipsis",
{
style: { color },
// When the label doesn't match content, screen readers read both
ariaHidden: label !== text, // this prevents that
},
text,
),
role: attrs.role,
selected: attrs.selected,
icon:
Expand Down

0 comments on commit 4d25b43

Please sign in to comment.