Skip to content

Commit

Permalink
fix: [Search:Behavioral Analytics page]Manage queries modal dialog mi…
Browse files Browse the repository at this point in the history
…ssing title from announcement (elastic#202705)

Closes: elastic#201925

**Description**
Dialog modal visible title should be announced for the users, especially
using assistive technology to know what dialog modal, flyout opened.

**Preconditions**
Stateful Behavioral Analytics page is opened.
Use Screen Reader (NVDA).

**Steps to reproduce**

1.Using only keyboard navigate to Create collection button by pressing
Tab key.
2.Press Enter.
3.Observe screen reader.

## Changes made:

1. aria-labelledby={modalTitleId} attribute was added for mentioned
EuiModal
  • Loading branch information
alexwizp authored Dec 11, 2024
1 parent d081990 commit acf0b35
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const AddAnalyticsCollectionModal: React.FC<AddAnalyticsCollectionModalPr
}) => {
const { isLoading, isSuccess, isSystemError, canSubmit } = useValues(AddAnalyticsCollectionLogic);
const modalFormId = useGeneratedHtmlId({ prefix: 'createAnalyticsCollection' });
const modalTitleId = useGeneratedHtmlId({ prefix: 'modalTitleId' });

useEffect(() => {
if (isSuccess || isSystemError) {
Expand All @@ -52,11 +53,12 @@ export const AddAnalyticsCollectionModal: React.FC<AddAnalyticsCollectionModalPr
<EuiModal
onClose={onClose}
maxWidth={minModalWidth}
aria-labelledby={modalTitleId}
initialFocus={`[name=${collectionNameField}]`}
>
<EuiModalHeader>
<EuiFlexItem>
<EuiModalHeaderTitle>
<EuiModalHeaderTitle id={modalTitleId}>
{i18n.translate('xpack.enterpriseSearch.analytics.collectionsCreate.form.title', {
defaultMessage: 'Name your Collection',
})}
Expand Down

0 comments on commit acf0b35

Please sign in to comment.