From 7cf144e0de7f4b4836a9b05578562e4e78c639df Mon Sep 17 00:00:00 2001 From: Cyril Date: Mon, 16 Mar 2026 13:55:03 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BF=EF=B8=8F(frontend)=20fix=20modal=20ar?= =?UTF-8?q?ia-label=20object=20Object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add aria-label on modals with JSX title to avoid returning object Object --- CHANGELOG.md | 1 + .../apps/e2e/__tests__/app-impress/doc-version.spec.ts | 4 ++-- .../apps/impress/src/components/modal/AlertModal.tsx | 2 +- .../BlockNoteToolBar/ModalConfirmDownloadUnsafe.tsx | 9 +++------ .../features/docs/doc-export/components/ModalExport.tsx | 2 +- .../features/docs/doc-header/components/AlertNetwork.tsx | 7 ++----- .../docs/doc-management/components/ModalRemoveDoc.tsx | 2 +- .../docs/doc-search/components/DocSearchModal.tsx | 1 - .../components/ModalConfirmationVersion.tsx | 2 +- .../doc-versioning/components/ModalSelectVersion.tsx | 3 +-- .../features/docs/docs-grid/components/DocMoveModal.tsx | 1 - 11 files changed, 13 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0fa37f3..60c732c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to - 🙈(docker) add **/.next to .dockerignore #2034 - ♿️(frontend) fix share modal heading hierarchy #2007 - ♿️(frontend) fix Copy link toast accessibility for screen readers #2029 +- ♿️(frontend) fix modal aria-label and name #2014 ## [v4.8.1] - 2026-03-17 diff --git a/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts b/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts index 38604672..799f0b73 100644 --- a/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts +++ b/src/frontend/apps/e2e/__tests__/app-impress/doc-version.spec.ts @@ -23,7 +23,7 @@ test.describe('Doc Version', () => { await page.getByRole('menuitem', { name: 'Version history' }).click(); await expect(page.getByText('History', { exact: true })).toBeVisible(); - const modal = page.getByLabel('version history modal'); + const modal = page.getByRole('dialog', { name: 'Version history' }); const panel = modal.getByLabel('version list'); await expect(panel).toBeVisible(); await expect(modal.getByText('No versions')).toBeVisible(); @@ -155,7 +155,7 @@ test.describe('Doc Version', () => { await page.getByLabel('Open the document options').click(); await page.getByRole('menuitem', { name: 'Version history' }).click(); - const modal = page.getByLabel('version history modal'); + const modal = page.getByRole('dialog', { name: 'Version history' }); const panel = modal.getByLabel('version list'); await expect(panel).toBeVisible(); diff --git a/src/frontend/apps/impress/src/components/modal/AlertModal.tsx b/src/frontend/apps/impress/src/components/modal/AlertModal.tsx index 0c1366d9..26a2ac80 100644 --- a/src/frontend/apps/impress/src/components/modal/AlertModal.tsx +++ b/src/frontend/apps/impress/src/components/modal/AlertModal.tsx @@ -56,7 +56,7 @@ export const AlertModal = ({ isOpen={isOpen} size={ModalSize.MEDIUM} onClose={onClose} - aria-describedby="alert-modal-title" + aria-label={title} title={ onClose()} - aria-describedby="modal-confirm-download-unsafe-title" + aria-label={t('Warning')} rightActions={ <>