Skip to content

Commit 8ff6d30

Browse files
committed
fixup! ✨(frontend) improve modal a11y: structure, labels, and title
1 parent b8fa5a5 commit 8ff6d30

File tree

7 files changed

+18
-5
lines changed

7 files changed

+18
-5
lines changed

src/frontend/apps/e2e/__tests__/app-impress/doc-search.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ test.describe('Document search', () => {
3333
).toBeVisible();
3434

3535
await expect(
36-
page.getByLabel('Search modal').getByText('search'),
36+
page.getByRole('heading', { name: 'Search docs' }),
3737
).toBeVisible();
3838

3939
const inputSearch = page.getByPlaceholder('Type the name of a document');
@@ -79,7 +79,7 @@ test.describe('Document search', () => {
7979

8080
await page.keyboard.press('Control+k');
8181
await expect(
82-
page.getByLabel('Search modal').getByText('search'),
82+
page.getByRole('heading', { name: 'Search docs' }),
8383
).toBeVisible();
8484

8585
await page.keyboard.press('Escape');

src/frontend/apps/impress/src/components/modal/AlertModal.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const AlertModal = ({
3535
<Text
3636
$size="h6"
3737
as="h1"
38+
$margin="0"
3839
id="alert-modal-title"
3940
$align="flex-start"
4041
$variation="1000"

src/frontend/apps/impress/src/features/docs/doc-export/components/ModalExport.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ export const ModalExport = ({ onClose, doc }: ModalExportProps) => {
167167
>
168168
<Text
169169
as="h1"
170+
$margin="0"
170171
id="modal-export-title"
171172
$size="h6"
172173
$variation="1000"

src/frontend/apps/impress/src/features/docs/doc-management/components/ModalRemoveDoc.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const ModalRemoveDoc = ({
9393
$size="h6"
9494
as="h1"
9595
id="modal-remove-doc-title"
96-
$margin={{ all: '0' }}
96+
$margin="0"
9797
$align="flex-start"
9898
$variation="1000"
9999
>

src/frontend/apps/impress/src/features/docs/doc-search/components/DocSearchModal.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ const DocSearchModalGlobal = ({
7373
$justify="space-between"
7474
className="--docs--doc-search-modal"
7575
>
76-
<Text as="h1" id="doc-search-modal-title" className="sr-only">
76+
<Text
77+
as="h1"
78+
$margin="0"
79+
id="doc-search-modal-title"
80+
className="sr-only"
81+
>
7782
{t('Search docs')}
7883
</Text>
7984
<Box $position="absolute" $css="top: 12px; right: 12px;">

src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalConfirmationVersion.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export const ModalConfirmationVersion = ({
105105
title={
106106
<Text
107107
as="h1"
108+
$margin="0"
108109
id="modal-confirmation-version-title"
109110
$size="h6"
110111
$align="flex-start"

src/frontend/apps/impress/src/features/docs/doc-versioning/components/ModalSelectVersion.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ export const ModalSelectVersion = ({
5959
$maxHeight="calc(100vh - 2em - 12px)"
6060
$overflow="hidden"
6161
>
62-
<Text as="h1" id="modal-select-version-title" className="sr-only">
62+
<Text
63+
as="h1"
64+
$margin="0"
65+
id="modal-select-version-title"
66+
className="sr-only"
67+
>
6368
{t('Version history')}
6469
</Text>
6570
<Box

0 commit comments

Comments
 (0)