[Accessibility] Fix issues with aria attributes from Lighthouse report (#2042)

This commit is contained in:
Alexander Zinchuk 2022-09-20 14:59:06 +02:00
parent fd45e5bc10
commit dd7cad20a6
4 changed files with 7 additions and 4 deletions

View File

@ -150,11 +150,11 @@ const Avatar: FC<OwnProps> = ({
const author = user ? getUserFullName(user) : (chat ? getChatTitle(lang, chat) : text); const author = user ? getUserFullName(user) : (chat ? getChatTitle(lang, chat) : text);
if (isSavedMessages) { if (isSavedMessages) {
content = <i className={buildClassName(cn.icon, 'icon-avatar-saved-messages')} aria-label={author} />; content = <i className={buildClassName(cn.icon, 'icon-avatar-saved-messages')} role="img" aria-label={author} />;
} else if (isDeleted) { } else if (isDeleted) {
content = <i className={buildClassName(cn.icon, 'icon-avatar-deleted-account')} aria-label={author} />; content = <i className={buildClassName(cn.icon, 'icon-avatar-deleted-account')} role="img" aria-label={author} />;
} else if (isReplies) { } else if (isReplies) {
content = <i className={buildClassName(cn.icon, 'icon-reply-filled')} aria-label={author} />; content = <i className={buildClassName(cn.icon, 'icon-reply-filled')} role="img" aria-label={author} />;
} else if (hasBlobUrl) { } else if (hasBlobUrl) {
content = ( content = (
<> <>

View File

@ -389,7 +389,9 @@ const MessageInput: FC<OwnProps & StateProps> = ({
id={editableInputId || EDITABLE_INPUT_ID} id={editableInputId || EDITABLE_INPUT_ID}
className={className} className={className}
contentEditable contentEditable
role="textbox"
dir="auto" dir="auto"
tabIndex={0}
onClick={focusInput} onClick={focusInput}
onChange={handleChange} onChange={handleChange}
onKeyDown={handleKeyDown} onKeyDown={handleKeyDown}

View File

@ -142,6 +142,7 @@ const Menu: FC<OwnProps> = ({
<div className="backdrop" onMouseDown={preventMessageInputBlurWithBubbling} /> <div className="backdrop" onMouseDown={preventMessageInputBlurWithBubbling} />
)} )}
<div <div
role="presentation"
ref={menuRef} ref={menuRef}
className={bubbleClassName} className={bubbleClassName}
style={buildStyle( style={buildStyle(

View File

@ -108,7 +108,7 @@ const MenuItem: FC<OwnProps> = (props) => {
return ( return (
<div <div
role="button" role="menuitem"
tabIndex={0} tabIndex={0}
className={fullClassName} className={fullClassName}
onClick={handleClick} onClick={handleClick}