Skip to content

Commit 400d46b

Browse files
authored
fix(SelectDialog): use headerText as accessibleName per default (#7327)
Fixes #7319
1 parent 7b68d03 commit 400d46b

File tree

1 file changed

+11
-1
lines changed
  • packages/main/src/components/SelectDialog

1 file changed

+11
-1
lines changed

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,16 @@ interface ListDomRefWithPrivateAPIs extends ListDomRef {
3737
}
3838

3939
export interface SelectDialogPropTypes
40-
extends Omit<DialogPropTypes, 'header' | 'headerText' | 'footer' | 'children' | 'state'>,
40+
extends Omit<DialogPropTypes, 'header' | 'headerText' | 'footer' | 'children' | 'state' | 'accessibleName'>,
4141
Pick<ListPropTypes, 'growing' | 'onLoadMore'> {
42+
/**
43+
* Defines the accessible name of the component.
44+
*
45+
* __Note:__ If not set, the dialog uses the `headerText` for its accessible name.
46+
*
47+
* @default undefined
48+
*/
49+
accessibleName?: DialogPropTypes['accessibleName'];
4250
/**
4351
* Defines the list items of the component.
4452
*
@@ -132,6 +140,7 @@ export interface SelectDialogPropTypes
132140
*/
133141
const SelectDialog = forwardRef<DialogDomRef, SelectDialogPropTypes>((props, ref) => {
134142
const {
143+
accessibleName,
135144
open,
136145
children,
137146
className,
@@ -279,6 +288,7 @@ const SelectDialog = forwardRef<DialogDomRef, SelectDialogPropTypes>((props, ref
279288
onBeforeOpen={handleBeforeOpen}
280289
onOpen={handleAfterOpen}
281290
onBeforeClose={handleBeforeClose}
291+
accessibleName={accessibleName ?? headerText}
282292
>
283293
<div className={classNames.headerContent} slot="header">
284294
{showClearButton && headerTextAlignCenter && (

0 commit comments

Comments
 (0)