Skip to content

Commit e5e5fba

Browse files
committed
✨(frontend) hide decorative icons from assistive tech with aria-hidden
improves accessibility by reducing screen reader noise from icon elements Signed-off-by: Cyril <c.gromoff@gmail.com>
1 parent 0894bcd commit e5e5fba

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to
1515
- ♿ improve accessibility by adding landmark roles to layout #1394
1616
- ♿ add document visible in list and openable via enter key #1365
1717
- ♿ add pdf outline property to enable bookmarks display #1368
18+
- ♿ hide decorative icons from assistive tech with aria-hidden #1404
1819

1920
### Fixed
2021

src/frontend/apps/e2e/__tests__/app-impress/utils-sub-pages.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,5 +63,5 @@ export const clickOnAddRootSubPage = async (page: Page) => {
6363
const rootItem = page.getByTestId('doc-tree-root-item');
6464
await expect(rootItem).toBeVisible();
6565
await rootItem.hover();
66-
await rootItem.getByRole('button', { name: 'add_box' }).click();
66+
await rootItem.getByRole('button', { name: /add subpage/i }).click();
6767
};

src/frontend/apps/impress/src/components/Icon.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,14 @@ export const Icon = ({
1212
variant = 'outlined',
1313
...textProps
1414
}: IconProps) => {
15+
const hasLabel = 'aria-label' in textProps || 'aria-labelledby' in textProps;
16+
const ariaHidden =
17+
'aria-hidden' in textProps ? textProps['aria-hidden'] : !hasLabel;
18+
1519
return (
1620
<Text
1721
{...textProps}
22+
aria-hidden={ariaHidden}
1823
className={clsx('--docs--icon-bg', textProps.className, {
1924
'material-icons-filled': variant === 'filled',
2025
'material-icons': variant === 'outlined',

src/frontend/apps/impress/src/features/docs/doc-tree/components/DocTreeItemActions.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ export const DocTreeItemActions = ({
181181
});
182182
}}
183183
color="primary"
184+
aria-label={t('Add subpage')}
184185
>
185186
<Icon
186187
variant="filled"

0 commit comments

Comments
 (0)