[9.1] Auto-fix violations of the @elastic/eui/require-aria-label-for-modals ESLint rule (#227623)#229259
Merged
kibanamachine merged 8 commits intoelastic:9.1from Aug 1, 2025
Merged
Conversation
… ESLint rule (elastic#227623) > [!CAUTION] >⚠️ Changes were made by GenAI. Please review carefully. > [!NOTE] > Only `EuiConfirmModal` part ## Summary This PR applies the auto-fix for the newly introduced `@elastic/eui/require-aria-label-for-modals` Ensures that EUI modal components `EuiConfirmModal` have either an `aria-label` or `aria-labelledby` prop for accessibility. This helps screen reader users understand the purpose and content of modal dialogs. ## Changes - For **function components**: 1. Verify whether `useGeneratedHtmlId` is imported from the `@elastic/eui` package. If not, add the following import. 2. Inside the render method, define a new constant: `const confirmModalTitleId = useGeneratedHtmlId();` - For **class components**: 1. Verify whether `htmlIdGenerator` is imported from the `@elastic/eui` package. If not, add the following import. 2. Inside the render method, define a new constant: `const confirmModalTitleId = htmlIdGenerator()('confirmModalTitle');` In both cases, add the following props to the `EuiConfirmModal` component: - `aria-labelledby={confirmModalTitleId}` - `titleProps={{ id: confirmModalTitleId }}` ## Related - elastic/eui#8843 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit f0dbc67)
Contributor
|
Pinging @elastic/fleet (Team:Fleet) |
Contributor
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
Contributor
|
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
Contributor
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
Contributor
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
cc @alexwizp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport
This will backport the following commits from
mainto9.1:Questions ?
Please refer to the Backport tool documentation