From 35e4d89545edbf4ee7c57558dce2518f5e9c89c0 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 28 Aug 2020 20:04:19 -0600 Subject: [PATCH] Add aria labels to menu options --- src/accessibility/context_menu/MenuItem.tsx | 3 ++- src/components/structures/UserMenu.tsx | 2 ++ src/i18n/strings/en_EN.json | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/accessibility/context_menu/MenuItem.tsx b/src/accessibility/context_menu/MenuItem.tsx index 64233e51ad..0bb169abf8 100644 --- a/src/accessibility/context_menu/MenuItem.tsx +++ b/src/accessibility/context_menu/MenuItem.tsx @@ -26,8 +26,9 @@ interface IProps extends React.ComponentProps { // Semantic component for representing a role=menuitem export const MenuItem: React.FC = ({children, label, ...props}) => { + const ariaLabel = props["aria-label"] || label; return ( - + { children } ); diff --git a/src/components/structures/UserMenu.tsx b/src/components/structures/UserMenu.tsx index 5db5371842..476fe19ad7 100644 --- a/src/components/structures/UserMenu.tsx +++ b/src/components/structures/UserMenu.tsx @@ -322,6 +322,7 @@ export default class UserMenu extends React.Component { { this.onSettingsOpen(e, null)} />