Skip to content

Commit 4b1384b

Browse files
committed
fix(files): improve aria attributes on search toggle button
add aria-pressed to convey toggle state, use static aria-label, and hide decorative SVG icon from screen readers.
1 parent af113b9 commit 4b1384b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/files/FilesPage.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,10 +377,11 @@ const FilesPage = ({
377377
className="pointer selected-item ml2"
378378
onClick={toggleSearch}
379379
title={showSearch ? t('hideSearch') : t('showSearch')}
380-
aria-label={showSearch ? t('hideSearch') : t('showSearch')}
380+
aria-label={t('showSearch')}
381+
aria-pressed={showSearch}
381382
style={{ height: '24px' }}
382383
>
383-
<GlyphSearch width="24" height="24" fill="currentColor" />
384+
<GlyphSearch width="24" height="24" fill="currentColor" aria-hidden="true" />
384385
</button>
385386
</div>
386387
</Header>

0 commit comments

Comments
 (0)