Skip to content

Conversation

@alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Sep 17, 2025

Closes: elastic/kibana#219496
Closes: elastic/kibana#216048
Closes: elastic/kibana#219342
Closes: elastic/kibana#216157
Closes: elastic/kibana#217137
Closes: elastic/kibana#217456
Closes: elastic/kibana#218397
Closes: elastic/kibana#225240

Summary

This PR addresses an accessibility issue in the EuiSelectableListItem component where screen readers would announce checked options multiple times due to duplicated or misplaced screen reader text. The main changes include:

  • Refactored the rendering of screen reader text for list items to ensure it is included only once, outside the visible text span.
  • Assigned a unique aria-describedby to each list item that references only the relevant screen reader description (previously set within the list item content).
  • Updated the EuiScreenReaderOnly component to accept a custom id prop, enabling proper linkage with accessibility attributes.
  • Adjusted the logic for generating and assigning descriptive text to checked, unchecked, excluded, and mixed states, ensuring clarity and a single source of truth for assistive technologies.
  • Applied a small fix to the EuiIcon component to correct an incorrect role attribute when aria-hidden is set to true.

Impact to users

🟢 There are no updates required by consumers.

QA

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)

@elastic elastic deleted a comment from elasticmachine Sep 17, 2025
@alexwizp alexwizp marked this pull request as ready for review September 17, 2025 11:41
@alexwizp alexwizp requested a review from a team as a code owner September 17, 2025 11:41
@elastic elastic deleted a comment from elasticmachine Sep 17, 2025
/**
* Optional CSS class(es) to apply to the outermost element of the component.
* This allows for custom styling or theming.
*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding these JSDoc 🙌🏻

css={cssStyles}
tabIndex={tabIndex}
role="img"
role={isAriaHidden ? undefined : 'img'}
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

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.

❌ NVDA + Firefox (duplicated announcement)

Kapture.2025-09-19.at.12.05.24.mp4

❌ NVDA + Chrome (duplicated announcement, label missing)

Kapture.2025-09-19.at.12.09.02.mp4

I checked how it works in production now as well:

NVDA + Firefox (duplicated label and "Checked" announcement, but label present and the screen reader only text is not duplicated)

Kapture.2025-09-19.at.12.13.04.mp4

The reported issues state that the label is repeated twice and the fact that it is "checked" is repeated twice. Now, the label is not repeated but the screen reader only text is.

I was testing this story.

Co-authored-by: Weronika Olejniczak <32842468+weronikaolejniczak@users.noreply.github.com>
@alexwizp
Copy link
Contributor Author

@weronikaolejniczak moved to Draft, will retest

@alexwizp alexwizp marked this pull request as draft September 19, 2025 12:51
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elasticmachine
Copy link
Collaborator

💔 Build Failed

Failed CI Steps

History

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment