Repository navigation
Backlog
Labels
bugSomething isn't working
Description
Description:
Image attachments and the full-screen ImageGallery modal in @embeddedchat/react contain several accessibility and keyboard navigation compliance issues:
-
Missing
altAttributes on<img>Tags (WCAG 1.1.1 Non-text Content - Level A):- In
packages/react/src/views/AttachmentHandler/ImageAttachment.js(lines 98 and 162),<img src={...} />elements lack analtattribute. - In
packages/react/src/views/AttachmentPreview/PreviewType/image.js(line 9), the upload preview image lacks analtattribute. - In
packages/react/src/views/ImageGallery/ImageGallery.js(line 107), full-screen gallery slides lack analtattribute.
Withoutalttext, screen readers announce raw URLs to blind users or ignore the images completely.
- In
-
Keyboard-Inaccessible Image Preview (WCAG 2.1.1 Keyboard Navigation):
- In
ImageAttachment.js(lines 97 and 113), the container that opens the image gallery is rendered as a plain<div>(<Box onClick={() => setShowGallery(true)}>). - It lacks
role="button",tabIndex="0", an accessible label, and keyboard listeners (Enter/Space). Keyboard-only users cannot tab to or open full-size image attachments.
- In
-
Missing
aria-labelandEscapeKey Listener inImageGallery(WCAG 4.1.2 & WCAG 2.1.2):- In
ImageGallery.js(lines 47-53), the close button (<ActionButton css={styles.exit} onClick={() => setShowGallery(false)}><Icon name="cross" /></ActionButton>) lacks anaria-label="Close image gallery". Screen readers announce it as a bare "Button". - When the gallery modal is open full-screen, pressing the
Escapekey does not dismiss the modal.
- In
Steps to reproduce:
- Open EmbeddedChat in Storybook or live chat.
- View an image attachment in chat history.
- Inspect the DOM in browser DevTools: observe that the
<img>tag has noaltattribute. - Try navigating to the image attachment using only the keyboard (
Tab): observe that focus completely skips the image, making it impossible to open the gallery via keyboard. - Click the image with a mouse to open the
ImageGallerymodal. - Press the
Escapekey: observe that the modal does not close. - Inspect the exit button: observe that it lacks an
aria-label.
Expected behavior:
- All
<img>tags should have descriptive or fallbackaltattributes (e.g.attachment.title || attachment.description || 'Image attachment'). - Clickable image attachment containers should have
role="button",tabIndex="0", a descriptivearia-label="View full image", and open onEnter/Spacekey presses. - The
ImageGalleryexit button should have anaria-label="Close image gallery". - Pressing
EscapeinImageGalleryshould close the modal and return focus to the triggering element.
Proposed Solution:
I would like to resolve this in @embeddedchat/react:
- Add proper
altattributes to images inImageAttachment.js,PreviewType/image.js, andImageGallery.js. - Make the image attachment trigger an accessible button (
role="button",tabIndex={0}, andonKeyDownhandling forEnterandSpace). - Add an
aria-labelto the exit button and anEscapekey event listener inImageGallery.js.
May I be assigned this issue?
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity