From dd7cad20a60a7a7e3dfbb593dc8105726978e8b7 Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Tue, 20 Sep 2022 14:59:06 +0200 Subject: [PATCH] [Accessibility] Fix issues with aria attributes from Lighthouse report (#2042) --- src/components/common/Avatar.tsx | 6 +++--- src/components/middle/composer/MessageInput.tsx | 2 ++ src/components/ui/Menu.tsx | 1 + src/components/ui/MenuItem.tsx | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx index b6cd23256..225cb9d97 100644 --- a/src/components/common/Avatar.tsx +++ b/src/components/common/Avatar.tsx @@ -150,11 +150,11 @@ const Avatar: FC = ({ const author = user ? getUserFullName(user) : (chat ? getChatTitle(lang, chat) : text); if (isSavedMessages) { - content = ; + content = ; } else if (isDeleted) { - content = ; + content = ; } else if (isReplies) { - content = ; + content = ; } else if (hasBlobUrl) { content = ( <> diff --git a/src/components/middle/composer/MessageInput.tsx b/src/components/middle/composer/MessageInput.tsx index 8e62022b8..c4030a9de 100644 --- a/src/components/middle/composer/MessageInput.tsx +++ b/src/components/middle/composer/MessageInput.tsx @@ -389,7 +389,9 @@ const MessageInput: FC = ({ id={editableInputId || EDITABLE_INPUT_ID} className={className} contentEditable + role="textbox" dir="auto" + tabIndex={0} onClick={focusInput} onChange={handleChange} onKeyDown={handleKeyDown} diff --git a/src/components/ui/Menu.tsx b/src/components/ui/Menu.tsx index 35df0989a..d702930bf 100644 --- a/src/components/ui/Menu.tsx +++ b/src/components/ui/Menu.tsx @@ -142,6 +142,7 @@ const Menu: FC = ({
)}
= (props) => { return (