Skip to content

Conversation

@alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Jun 20, 2025

Summary

This PR introduces the first in a new series of accessibility (a11y) rules for the EUI ESLint plugin:

- @elastic/eui/require-aria-label-for-modals

This rule enforces that all EUI modal components—EuiModal, EuiFlyout, and EuiConfirmModal—include either an aria-label or aria-labelledby prop. This ensures modal dialogs are accessible to screen reader users by providing meaningful context about the modal’s purpose and content.

Screens:

  • EuiModal, EuiFlyout:
Screenshot 2025-06-20 at 13 19 54
  • EuiConfirmModal:
Screenshot 2025-06-20 at 13 21 14

@alexwizp alexwizp marked this pull request as ready for review June 20, 2025 10:37
@alexwizp alexwizp requested a review from a team as a code owner June 20, 2025 10:37
@weronikaolejniczak weronikaolejniczak self-requested a review June 20, 2025 10:37
Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's one test failing. Other than that, it looks squeaky clean ✨, thank you for contributing!

Screenshot 2025-06-20 at 13 51 27

Copy link
Contributor

@weronikaolejniczak weronikaolejniczak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🟢 Tests are passing.

Screenshot 2025-06-20 at 14 24 44

we really gotta add them to the CI...

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@alexwizp alexwizp merged commit efe948f into elastic:main Jun 20, 2025
5 checks passed
weronikaolejniczak added a commit to elastic/kibana that referenced this pull request Jul 15, 2025
`@elastic/eslint-plugin-eui`: `2.0.0` ⏩ `2.1.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[`v2.1.0`](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.1.0)

### `@elastic/eui/require-aria-label-for-modals` (fixed with GenAI:
#227623)

Ensures that EUI modal components (`EuiModal`, `EuiFlyout`,
`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.

### `@elastic/eui/consistent-is-invalid-props` (auto-fix available)

Ensures that form control components within `EuiFormRow` components have
matching `isInvalid` prop values. This maintains consistent validation
state between parent form rows and their child form controls, leading to
a more predictable and accessible user experience.

### `@elastic/eui/sr_output_disabled_tooltip` (auto-fix available)

Ensures `disableScreenReaderOutput` is set when `EuiToolTip` content
matches `EuiButtonIcon`'s `aria-label`.

> [!NOTE]
> `@elastic/eui/sr_output_disabled_tooltip` will be renamed to
`@elastic/eui/sr-output-disabled-tooltip` for consistent rule naming.

## Package updates

### `@elastic/eslint-plugin-eui`

- Added new `sr_output_disabled_tooltip` rule.
([#8848](elastic/eui#8848))
- Added new `consistent-is-invalid-props` rule.
([#8843](elastic/eui#8843))
- Added new `require-aria-label-for-modals` rule.
([#8811](elastic/eui#8811))
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
`@elastic/eslint-plugin-eui`: `2.0.0` ⏩ `2.1.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[`v2.1.0`](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.1.0)

### `@elastic/eui/require-aria-label-for-modals` (fixed with GenAI:
elastic#227623)

Ensures that EUI modal components (`EuiModal`, `EuiFlyout`,
`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.

### `@elastic/eui/consistent-is-invalid-props` (auto-fix available)

Ensures that form control components within `EuiFormRow` components have
matching `isInvalid` prop values. This maintains consistent validation
state between parent form rows and their child form controls, leading to
a more predictable and accessible user experience.

### `@elastic/eui/sr_output_disabled_tooltip` (auto-fix available)

Ensures `disableScreenReaderOutput` is set when `EuiToolTip` content
matches `EuiButtonIcon`'s `aria-label`.

> [!NOTE]
> `@elastic/eui/sr_output_disabled_tooltip` will be renamed to
`@elastic/eui/sr-output-disabled-tooltip` for consistent rule naming.

## Package updates

### `@elastic/eslint-plugin-eui`

- Added new `sr_output_disabled_tooltip` rule.
([elastic#8848](elastic/eui#8848))
- Added new `consistent-is-invalid-props` rule.
([elastic#8843](elastic/eui#8843))
- Added new `require-aria-label-for-modals` rule.
([elastic#8811](elastic/eui#8811))
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
`@elastic/eslint-plugin-eui`: `2.0.0` ⏩ `2.1.0`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

## Changes

This PR updates the `@elastic/eslint-plugin-eui` version to latest:
[`v2.1.0`](https://www.npmjs.com/package/@elastic/eslint-plugin-eui/v/2.1.0)

### `@elastic/eui/require-aria-label-for-modals` (fixed with GenAI:
elastic#227623)

Ensures that EUI modal components (`EuiModal`, `EuiFlyout`,
`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.

### `@elastic/eui/consistent-is-invalid-props` (auto-fix available)

Ensures that form control components within `EuiFormRow` components have
matching `isInvalid` prop values. This maintains consistent validation
state between parent form rows and their child form controls, leading to
a more predictable and accessible user experience.

### `@elastic/eui/sr_output_disabled_tooltip` (auto-fix available)

Ensures `disableScreenReaderOutput` is set when `EuiToolTip` content
matches `EuiButtonIcon`'s `aria-label`.

> [!NOTE]
> `@elastic/eui/sr_output_disabled_tooltip` will be renamed to
`@elastic/eui/sr-output-disabled-tooltip` for consistent rule naming.

## Package updates

### `@elastic/eslint-plugin-eui`

- Added new `sr_output_disabled_tooltip` rule.
([elastic#8848](elastic/eui#8848))
- Added new `consistent-is-invalid-props` rule.
([elastic#8843](elastic/eui#8843))
- Added new `require-aria-label-for-modals` rule.
([elastic#8811](elastic/eui#8811))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants