Skip to content

Conversation

@mgadewoll
Copy link
Contributor

@mgadewoll mgadewoll commented Jun 27, 2025

Summary

closes #8826

This PR adds support for handling custom option ids. Since the component uses generic types for the options, it's possible for consumers to pass id (e.g. for additional sorting on implementation side).
To ensure that the accessible linking between options and input works as expected via aria-activedescendant this PR updates EuiComboBox by using the id value from the actual available option DOM elements instead of passing a static id based on the activeOptionIndex.
This ensures that the following two scenarios work and ensure that the component results in an accessible output when navigating the options list:

  • default (no-custom) ids
  • custom option ids passed as part of the options shape

Why are we making this change?

This update ensures that the accessibility of EuiComboBox is more robust towards consumer input and can't be broken as easily.

Screenshots

before

image

after

no-custom ids (default) custom ids
Screen.Recording.2025-06-27.at.20.40.28.mov
Screen.Recording.2025-06-27.at.20.41.04.mov

Impact to users

🟢 This update does not require any updates on consumer side.

QA

  • checkout this PR, run storybook and view the stories EuiComboBox > Playground and EuiComboBox > With Custom Ids
    • using the story EuiComboBox > Playground, verify using a screen reader that the options are correctly announced on keyboard navigation in the options list
    • using the story EuiComboBox > With Custom Ids, verify using a screen reader that the options are correctly announced on keyboard navigation in the options list

General checklist

  • Browser QA
    • Checked in both light and dark modes
    • Checked in both MacOS and Windows high contrast modes
    • Checked in mobile
    • Checked in Chrome, Safari, Edge, and Firefox
    • Checked for accessibility including keyboard-only and screenreader modes
  • Docs site QA
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
    • If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist
    • If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)

@mgadewoll mgadewoll self-assigned this Jun 27, 2025
@mgadewoll mgadewoll marked this pull request as ready for review June 27, 2025 19:36
@mgadewoll mgadewoll requested a review from a team as a code owner June 27, 2025 19:36
- this ensures that consumers can pass custom ids on options without breaking the internal accessibility handling of combobox
- ensures both usages of ids result in expected accessible markup
@mgadewoll mgadewoll force-pushed the combobox/8826-support-custom-ids branch from edf15b4 to 623d5a0 Compare June 27, 2025 19:40
@acstll acstll self-requested a review June 30, 2025 09:01
Copy link
Contributor

@acstll acstll left a comment

Choose a reason for hiding this comment

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

🟢 I tested the changes locally with NVDA on Windows 11 (woohoo), it works as expected (also tested the current implementation, when passing ids in the options list it'll yield "blank").

I'm approving but also leaving a couple of comments regarding names that you may consider.

mgadewoll added 2 commits July 1, 2025 10:31
- updates setListOptions to setListOptionRefs
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @mgadewoll

@mgadewoll mgadewoll merged commit 24c5822 into elastic:main Jul 1, 2025
5 checks passed
acstll added a commit to elastic/kibana that referenced this pull request Jul 14, 2025
`104.1.0` ⏩ `105.0.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)

## Package updates

### `@elastic/eui`

#### [`v105.0.0`](https://github.com/elastic/eui/releases/v105.0.0)

- Added marked row styling via the classes `euiDataGridRow--marked` and
`euiTableRow--marked` for `EuiDataGrid` and `EuiBasicTable`
([#8834](elastic/eui#8834))
- Added component tokens:
([#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`
- Added `EuiFlyoutChild` and `EuiFlyoutSessionProvider`
([#8771](elastic/eui#8771))
- Added `setListOptionRefs` prop on `EuiComboBoxList`
([#8829](elastic/eui#8829))

**Breaking changes**

- Removed `iInCircle` icon (use `info` instead)
([#8841](elastic/eui#8841))
- Removed `questionInCircle` icon (use `question` instead)
([#8841](elastic/eui#8841))

**Accessibility**

- Improved the experience of `EuiProgress` by ensuring that determinate
updates are read out immediately to screen readers
([#8839](elastic/eui#8839))
- Fixed missing screen reader output for `EuiComboBox` with `options`
that have custom `id` attributes
([#8829](elastic/eui#8829))

### `@elastic/eui-theme-borealis`

####
[`v3.2.0`](https://github.com/elastic/eui/blob/main/packages/eui-theme-borealis/changelogs/CHANGELOG_2025.md#v320)

- Added component tokens:
([#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`

## Summary

- **Marked row styling** for `EuiDataGrid` and `EuiBasicTable`: new CSS
classes are available for consistent styling of marked rows (different
from selected), including hover and cell outline styles
(elastic/eui#8834)
- **New flyout component**: `EuiFlyoutChild` allows side-by-side
(grouped) flyout panels (elastic/eui#8771)
- **Accessibility fixes:**
- `EuiComboBox` now supports custom option `id`s
(elastic/eui#8829)
- Updates on `EuiProgress` are properly announced by screen readers
(elastic/eui#8839)
- **Icon updates** (breaking change): `iInCircle` and `questionInCircle`
icons have been renamed to `info` and `question` respectively
(elastic/eui#8841)

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Lene Gadewoll <[email protected]>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
`104.1.0` ⏩ `105.0.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)

## Package updates

### `@elastic/eui`

#### [`v105.0.0`](https://github.com/elastic/eui/releases/v105.0.0)

- Added marked row styling via the classes `euiDataGridRow--marked` and
`euiTableRow--marked` for `EuiDataGrid` and `EuiBasicTable`
([elastic#8834](elastic/eui#8834))
- Added component tokens:
([elastic#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`
- Added `EuiFlyoutChild` and `EuiFlyoutSessionProvider`
([elastic#8771](elastic/eui#8771))
- Added `setListOptionRefs` prop on `EuiComboBoxList`
([elastic#8829](elastic/eui#8829))

**Breaking changes**

- Removed `iInCircle` icon (use `info` instead)
([elastic#8841](elastic/eui#8841))
- Removed `questionInCircle` icon (use `question` instead)
([elastic#8841](elastic/eui#8841))

**Accessibility**

- Improved the experience of `EuiProgress` by ensuring that determinate
updates are read out immediately to screen readers
([elastic#8839](elastic/eui#8839))
- Fixed missing screen reader output for `EuiComboBox` with `options`
that have custom `id` attributes
([elastic#8829](elastic/eui#8829))

### `@elastic/eui-theme-borealis`

####
[`v3.2.0`](https://github.com/elastic/eui/blob/main/packages/eui-theme-borealis/changelogs/CHANGELOG_2025.md#v320)

- Added component tokens:
([elastic#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`

## Summary

- **Marked row styling** for `EuiDataGrid` and `EuiBasicTable`: new CSS
classes are available for consistent styling of marked rows (different
from selected), including hover and cell outline styles
(elastic/eui#8834)
- **New flyout component**: `EuiFlyoutChild` allows side-by-side
(grouped) flyout panels (elastic/eui#8771)
- **Accessibility fixes:**
- `EuiComboBox` now supports custom option `id`s
(elastic/eui#8829)
- Updates on `EuiProgress` are properly announced by screen readers
(elastic/eui#8839)
- **Icon updates** (breaking change): `iInCircle` and `questionInCircle`
icons have been renamed to `info` and `question` respectively
(elastic/eui#8841)

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Lene Gadewoll <[email protected]>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
`104.1.0` ⏩ `105.0.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)

## Package updates

### `@elastic/eui`

#### [`v105.0.0`](https://github.com/elastic/eui/releases/v105.0.0)

- Added marked row styling via the classes `euiDataGridRow--marked` and
`euiTableRow--marked` for `EuiDataGrid` and `EuiBasicTable`
([elastic#8834](elastic/eui#8834))
- Added component tokens:
([elastic#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`
- Added `EuiFlyoutChild` and `EuiFlyoutSessionProvider`
([elastic#8771](elastic/eui#8771))
- Added `setListOptionRefs` prop on `EuiComboBoxList`
([elastic#8829](elastic/eui#8829))

**Breaking changes**

- Removed `iInCircle` icon (use `info` instead)
([elastic#8841](elastic/eui#8841))
- Removed `questionInCircle` icon (use `question` instead)
([elastic#8841](elastic/eui#8841))

**Accessibility**

- Improved the experience of `EuiProgress` by ensuring that determinate
updates are read out immediately to screen readers
([elastic#8839](elastic/eui#8839))
- Fixed missing screen reader output for `EuiComboBox` with `options`
that have custom `id` attributes
([elastic#8829](elastic/eui#8829))

### `@elastic/eui-theme-borealis`

####
[`v3.2.0`](https://github.com/elastic/eui/blob/main/packages/eui-theme-borealis/changelogs/CHANGELOG_2025.md#v320)

- Added component tokens:
([elastic#8834](elastic/eui#8834))
  - `dataGridRowBackgroundMarked`
  - `dataGridRowBackgroundMarkedHover`
  - `dataGridRowBorderActive`
  - `dataGridRowBorderHover`
  - `dataGridRowBorderMarked`
  - `tableRowBackgroundMarked`
  - `tableRowBackgroundMarkedHover`

## Summary

- **Marked row styling** for `EuiDataGrid` and `EuiBasicTable`: new CSS
classes are available for consistent styling of marked rows (different
from selected), including hover and cell outline styles
(elastic/eui#8834)
- **New flyout component**: `EuiFlyoutChild` allows side-by-side
(grouped) flyout panels (elastic/eui#8771)
- **Accessibility fixes:**
- `EuiComboBox` now supports custom option `id`s
(elastic/eui#8829)
- Updates on `EuiProgress` are properly announced by screen readers
(elastic/eui#8839)
- **Icon updates** (breaking change): `iInCircle` and `questionInCircle`
icons have been renamed to `info` and `question` respectively
(elastic/eui#8841)

---------

Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Lene Gadewoll <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[EuiComboBox][A11y] Passing custom option ids breaks accessibility

3 participants