Skip to content

Commit

Permalink
fix: [Search:SearchApplications:Connect page]Missing modal dialog tit…
Browse files Browse the repository at this point in the history
…le from announcement (elastic#199738)

Closes: elastic#199627

## Description
Titles for the dialogs are announced for the users, that users using
assistive technology would know that the dialog opened and what dialog
opened.

## What was changed?:

1. `aria-labelledby={modalTitleId}` was added. See
https://eui.elastic.co/#/layout/modal for details

## Screen: 

<img width="1289" alt="Screenshot 2024-11-12 at 11 35 28"
src="https://github.com/user-attachments/assets/ab3e1764-6617-4f50-82de-d6565a0e9c73">
  • Loading branch information
alexwizp authored and CAWilson94 committed Nov 18, 2024
1 parent f492e15 commit 6ff42d7
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
EuiText,
EuiCallOut,
EuiCodeBlock,
useGeneratedHtmlId,
} from '@elastic/eui';

import { i18n } from '@kbn/i18n';
Expand All @@ -45,6 +46,7 @@ export const GenerateSearchApplicationApiKeyModal: React.FC<
> = ({ onClose, searchApplicationName }) => {
const { keyName, apiKey, isLoading, isSuccess } = useValues(GenerateApiKeyModalLogic);
const { setKeyName } = useActions(GenerateApiKeyModalLogic);
const modalTitleId = useGeneratedHtmlId();
const { makeRequest } = useActions(GenerateSearchApplicationApiKeyLogic);
const copyApiKeyRef = useRef<HTMLAnchorElement>(null);

Expand All @@ -59,9 +61,9 @@ export const GenerateSearchApplicationApiKeyModal: React.FC<
}, [isSuccess]);

return (
<EuiModal onClose={onClose}>
<EuiModal onClose={onClose} aria-labelledby={modalTitleId}>
<EuiModalHeader>
<EuiModalHeaderTitle>
<EuiModalHeaderTitle id={modalTitleId}>
{i18n.translate(
'xpack.enterpriseSearch.searchApplication.searchApplication.api.generateApiKeyModal.title',
{
Expand Down

0 comments on commit 6ff42d7

Please sign in to comment.