️(frontend) fix aria-labels for table of contents nav vs buttons

Screen readers announce nav as "Sommaire, navigation" and button as toggle.
This commit is contained in:
Cyril 2026-03-18 10:56:31 +01:00
parent 03b6c6a206
commit d6333c9b81
No known key found for this signature in database
GPG key ID: D5E8474B0AB0064A
3 changed files with 10 additions and 4 deletions

View file

@ -16,6 +16,10 @@ and this project adheres to
- ♿️(frontend) add sr-only format to export download button #2088
- ♿️(frontend) announce formatting shortcuts for screen readers #2070
### Fixed
- ♿️(frontend) fix aria-labels for table of contents #2065
## [v4.8.2] - 2026-03-19
### Added

View file

@ -19,7 +19,9 @@ test.describe('Doc Table Content', () => {
await page.locator('.ProseMirror').click();
await expect(page.getByRole('button', { name: 'Summary' })).toBeHidden();
await expect(
page.getByRole('button', { name: 'Show the table of contents' }),
).toBeHidden();
await page.keyboard.type('# Level 1\n## Level 2\n### Level 3');

View file

@ -91,7 +91,7 @@ export const TableContent = () => {
$height="100%"
$justify="center"
$align="center"
aria-label={t('Summary')}
aria-label={t('Show the table of contents')}
aria-expanded={isOpen}
aria-controls="toc-list"
$css={css`
@ -218,8 +218,8 @@ const TableContentOpened = ({
onClick={onClose}
$justify="center"
$align="center"
aria-label={t('Summary')}
aria-expanded="true"
aria-label={t('Hide the table of contents')}
aria-expanded={true}
aria-controls="toc-list"
$css={css`
transition: none !important;