Skip to content

[EuiSuperSelect] Combine external labels with the selected value in the accessible name - #10039

Merged
alexwizp merged 10 commits into
elastic:mainfrom
alexwizp:a11y/super-select-compose-aria-label
Oct 2, 2026
Merged

alexwizp merged 10 commits into
elastic:mainfrom
alexwizp:a11y/super-select-compose-aria-label

Conversation

@alexwizp

@alexwizp alexwizp commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Closes: elastic/kibana#290234
Closes: elastic/kibana#289551

Summary

What: EuiSuperSelect no longer lets a consumer-passed aria-label / aria-labelledby override the selected value in the control's accessible name — the two are now combined.

Why: Previously, any aria-label/aria-labelledby replaced the button's accessible name entirely, so a super select labelled only with aria-label="Flow target" announced as "Flow target, list box pop up collapsed, button" — screen reader users couldn't tell what was selected without opening the dropdown (WCAG 4.1.2). ~40 of Kibana's 144 EuiSuperSelect usages hit this.

How: External labels are rendered into a screen-reader-only <span> and referenced by id, instead of being set directly on the button. The button always self-references alongside that label id, so its own content (the selected value) stays part of the accessible name. Precedence: consumer aria-labelledby → consumer aria-label → EuiFormRow label (unchanged).

Accessible name for the linked issue goes from "Flow target" to "As destination Flow target".

API Changes

No public API change — same props, corrected behavior.

component / parent prop / child change description
EuiSuperSelect aria-label Behavior Rendered as a screen reader only element and combined with the selected value instead of overriding it; no longer present as an aria-label attribute on the control button
EuiSuperSelect aria-labelledby Behavior Combined with the control button's own id so the selected value stays part of the accessible name

Screenshots

No visual change — screen reader announcement only.

Before After
"Flow target, list box pop up collapsed, button" "As destination Flow target, list box pop up collapsed, button"

Impact Assessment

  • 🔴 Breaking changes
  • 💅 Visual changes — none; the added element is EuiScreenReaderOnly.
  • 🧪 Test impact — rendered HTML changes for any EuiSuperSelect given an aria-label: a screen reader only <span> is added, the button gains id + aria-labelledby and loses aria-label. Three EUI snapshots updated (super_select, super_select_control, color_palette_picker).
  • 🔧 Hard to integrate

Not yet tested in Kibana — doing that next to size the downstream test churn.

Impact level: 🟡 Moderate

Release Readiness

  • Documentation: no docs change — behavior fix, existing props.
  • Figma
  • Migration guide
  • Adoption plan

QA instructions for reviewer

  • Open the EuiSuperSelect docs/Storybook with a super select that has aria-label set and a selected value.
  • With VoiceOver (or NVDA), confirm the announcement includes both the selected option and the label, e.g. "Option Table cells should have a way to turn off text mode #2 Label, list box pop up collapsed, button".
  • Confirm the same for a super select wrapped in EuiFormRow with a label.
  • Confirm a super select with no label at all still announces just the selected value.
  • Confirm the placeholder case still announces the placeholder text.

Checklist before marking Ready for Review

  • Filled out all sections above
  • QA: Tested light/dark modes, high contrast, mobile, Chrome/Safari/Edge/Firefox, keyboard-only, screen reader — not done yet
  • QA: Tested in CodeSandbox and Kibana — not done yet
  • QA: Tested docs changes
  • Tests: Added Jest coverage for the aria-label, aria-labelledby, and no-label cases; updated affected snapshots.
  • Changelog: packages/eui/changelogs/upcoming/10039.md
  • Breaking changes: label

Reviewer checklist

  • Approved Impact Assessment
  • Approved Release Readiness

`EuiSuperSelectControl` renders the selected option's `inputDisplay` as
the button's text content, and only self-referenced the button via
`aria-labelledby` when an `EuiFormRow` label was detected. A
consumer-passed `aria-label`/`aria-labelledby` was spread straight onto
the button, so it replaced the text content in the accessible name
computation and the selected value was never announced.

External labels are no longer set on the button directly: `aria-label`
is rendered into a screen reader only element and the button always
self-references alongside the external label id, so the accessible name
becomes "<selected value>, <label>".

Changelog file is named for the expected PR number and should be renamed
once the PR is opened.
@alexwizp
alexwizp marked this pull request as ready for review September 16, 2026 12:20
@alexwizp
alexwizp requested a review from a team as a code owner September 16, 2026 12:20
Copilot AI lite review requested due to automatic review settings September 16, 2026 12:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The accessibility behavior change requires human review and real screen-reader and integration validation.

Pull request overview

Updates EuiSuperSelect so external labels combine with the selected value in the accessible name.

Changes:

  • Adds screen-reader-only external labels and self-referencing button IDs.
  • Adds accessible-name test coverage.
  • Updates snapshots and changelog documentation.
File summaries
File Summary
packages/eui/src/components/form/super_select/super_select.test.tsx Tests accessible-name behavior.
packages/eui/src/components/form/super_select/super_select_control.tsx Implements combined accessible names.
packages/eui/src/components/form/super_select/__snapshots__/super_select.test.tsx.snap Updates rendered markup snapshot.
packages/eui/src/components/form/super_select/__snapshots__/super_select_control.test.tsx.snap Updates control snapshot.
packages/eui/src/components/color_picker/color_palette_picker/__snapshots__/color_palette_picker.test.tsx.snap Updates propagated control markup.
packages/eui/changelogs/upcoming/10039.md Documents the accessibility fix.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Kibana Regression Integration Test

Status: 💔 Kibana CI failed
Branch: update-dependencies/1790181095
Kibana PR: elastic/kibana#293062

Please check Kibana CI logs for details.

@weronikaolejniczak weronikaolejniczak left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM but we need to prep Kibana changes and make sure CI passes

alexwizp and others added 4 commits September 29, 2026 17:34
It rendered as real (non-aria-hidden) DOM content inside the button,
while the external label span it was meant to precede lives outside
the button. That made it show up as a dangling ", " in plain
textContent assertions (e.g. Kibana Playwright toHaveText checks)
wherever a label was present. The browser already inserts a space
between multiple aria-labelledby idrefs, so no manual separator is
needed; this also fixes the pre-existing stray-comma edge case on the
form-row path when there is no selected value or placeholder.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
…pose-aria-label

# Conflicts:
#	packages/release-cli/kibana-prep-commits
@alexwizp

alexwizp commented Oct 2, 2026

Copy link
Copy Markdown
Contributor Author

kibana-prep-commit: elastic/kibana#294177 💚 Build Succeeded

@alexwizp
alexwizp enabled auto-merge (squash) October 2, 2026 08:52
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

💚 Build Succeeded

History

@alexwizp
alexwizp merged commit 7fad9a2 into elastic:main Oct 2, 2026
7 checks passed
skynetigor pushed a commit to skynetigor/kibana that referenced this pull request Oct 7, 2026
## Dependency updates

`@elastic/eui` - v123.0.0 ⏩ v123.1.0

## Package updates

### `@elastic/eui`
[v123.1.0](https://github.com/elastic/eui/blob/main/packages/eui/changelogs/CHANGELOG_2026.md)

- Removed the left color highlight from `EuiCallOut`
([elastic#10109](elastic/eui#10109))
- Updated Flyout menu height to 50px
([elastic#10103](elastic/eui#10103))
- Added new icons: `chartMix`, `chartWaffle`, `clipboardWarning`,
`clockUp`, `emergencyLight`, `productCanvas`, `productElasticAgent`,
`productFleet`, `productLens`, `puzzlePiece`, `shield`
([elastic#10111](elastic/eui#10111))
- Added `hasAriaDisabled` prop on `EuiSelectableListItem` and `type
EuiSelectableOption`
([elastic#10090](elastic/eui#10090))
- Added refs for `EuiFlyoutHeader`, `EuiFlyoutFooter`, and the outer
`EuiFlyout` scroll container.
([elastic#10105](elastic/eui#10105))
- Corrected `EuiFlyoutHeaderProps`, `EuiFlyoutFooterProps`, and
`EuiFlyoutBodyProps` to describe component props instead of component
types. ([elastic#10105](elastic/eui#10105))
- Updated `EuiFormRow`'s `labelAppend` to render string content with an
extra-small, subdued text style.
([elastic#10067](elastic/eui#10067))

**Bug fixes**

- Fixed a bug on `EuiSelectable` with `searchable={true}` that could
result in an infinite loop if all search results are disabled
([elastic#10090](elastic/eui#10090))
- Fixed `EuiSuperSelect` omitting the currently selected value from its
accessible name when an `aria-label` or `aria-labelledby` was passed.
External labels are now combined with the selected value instead of
overriding it ([elastic#10039](elastic/eui#10039))

---------

Co-authored-by: Ángeles Martínez Barrio <[email protected]>
Co-authored-by: Alexey Antonov <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
weronikaolejniczak added a commit to boriskirov/eui that referenced this pull request Nov 11, 2026
…he accessible name (elastic#10039)

Co-authored-by: Weronika Olejniczak <[email protected]>
Co-authored-by: Claude Sonnet 5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accessibility ci:regression-integration-test-kibana Run a Regression Integration Test in Kibana against this PR

Projects

None yet

3 participants