From 4d25b436fb77a26ac656f4210bdae643cc6c0fdb Mon Sep 17 00:00:00 2001 From: hrb-hub <181954414+hrb-hub@users.noreply.github.com> Date: Tue, 12 Nov 2024 12:58:00 +0100 Subject: [PATCH] Prevent screen reader from reading dropdown options twice Close #7125 Co-authored-by: bir --- src/common/gui/base/buttons/RowButton.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/common/gui/base/buttons/RowButton.ts b/src/common/gui/base/buttons/RowButton.ts index 95fee8e6114..451e1dc3a70 100644 --- a/src/common/gui/base/buttons/RowButton.ts +++ b/src/common/gui/base/buttons/RowButton.ts @@ -28,7 +28,15 @@ export class RowButton implements Component { 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: