Skip to content

Commit 340a2e2

Browse files
fix(MessageBox - a11y): announce message boxes as alert dialog (#4390)
Fixes #3431
1 parent 473f9e6 commit 340a2e2

File tree

1 file changed

+9
-1
lines changed
  • packages/main/src/components/MessageBox

1 file changed

+9
-1
lines changed

packages/main/src/components/MessageBox/index.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,14 @@ import { enrichEventWithDetails, useI18nBundle, useIsomorphicId } from '@ui5/web
55
import { clsx } from 'clsx';
66
import React, { cloneElement, forwardRef, isValidElement, ReactNode } from 'react';
77
import { createUseStyles } from 'react-jss';
8-
import { ButtonDesign, MessageBoxActions, MessageBoxTypes, TitleLevel, ValueState } from '../../enums';
8+
import {
9+
ButtonDesign,
10+
MessageBoxActions,
11+
MessageBoxTypes,
12+
PopupAccessibleRole,
13+
TitleLevel,
14+
ValueState
15+
} from '../../enums';
916
import {
1017
ABORT,
1118
CANCEL,
@@ -217,6 +224,7 @@ const MessageBox = forwardRef<DialogDomRef, MessageBoxPropTypes>((props, ref) =>
217224
className={clsx(classes.messageBox, className)}
218225
onAfterClose={open ? handleOnClose : stopPropagation}
219226
accessibleNameRef={needsCustomHeader ? `${messageBoxId}-title ${messageBoxId}-text` : undefined}
227+
accessibleRole={PopupAccessibleRole.AlertDialog}
220228
{...restWithoutOmitted}
221229
headerText={titleToRender()}
222230
state={convertMessageBoxTypeToState(type as MessageBoxTypes)}

0 commit comments

Comments
 (0)