Skip to content

[EuiCollapsibleNavBeta] Consider adding aria-hidden="true" to the icon button for screen reader UX #7353

Description

@1Copenut

Is your feature request related to a problem? Please describe.
The current refactor of EuiCollapsibleNavBeta ( #7337 ) makes tremendous improvements for visual and keyboard UX. I'd like to add on to that work and propose hiding accordions' icon button from screen readers to avoid two buttons in Form Controls menus with the same accessible names.

Describe the solution you'd like
The expand/collapse accordions in EuiCollapsibleNavBeta is composed of two EuiButton components as sibling elements. The second button has a tabindex="-1" to remove it from the tab order. I'd like to take this a step further and add aria-hidden="true" to this button to remove a duplicate announcement for screen reader users.

Additional context
All three screen readers (VoiceOver, NVDA, JAWS) announced each button twice in their respective Form Controls menu and when traversing using the virtual cursor.

Activity

  1. JasonStoltz commented on Nov 20, 2023

    @JasonStoltz
    Contributor

    Estimating this as "Medium" because there may be complexities with other aria attributes nested in EUIIcon

  2. github-actions commented on May 19, 2024

    @github-actions

    👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.

  3. added
    stale-issue
    on May 19, 2024
  4. added
    Stale
    and removed
    stale-issue
    Stale
    on Oct 4, 2024
  5. weronikaolejniczak commented on Jan 16, 2025

    @weronikaolejniczak
    Contributor

    @JasonStoltz could you elaborate on the complexities you mentioned? Do you remember any details?

    As far as I know, setting aria-hidden on a duplicated icon button will make all of its children inaccessible to screen readers too.

    Adding aria-hidden="true" to an element removes that element and all of its children from the accessibility tree. This can improve the experience for assistive technology users by hiding:
    Purely decorative content, such as icons or images
    Duplicated content, such as repeated text
    Offscreen or collapsed content, such as menus
    The presence of the aria-hidden attribute hides content from assistive technology but doesn't visually hide anything.

    (source: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-hidden)

  6. mgadewoll commented on Feb 7, 2025

    @mgadewoll
    Contributor

    I checked the changes running screen readers (VoiceOver on Mac and NVDA on Windows):

    ✅ The icon button is marked as aria-hidden and hence not focusable/readable by screen readers.
    ✅ There is no more duplication of toggle elements.
    ✅ Both default keyboard navigation and screen reader browse mode navigation work as expected and provide expected information

    VoiceOver

    Screen.Recording.2025-02-07.at.13.49.08.mov

    perceivable buttons before

    Image

    perceivable buttons after

    Image

    NVDA

    Screen.Recording.2025-02-07.at.13.47.03.mov

    perceivable buttons before

    Image

    perceivable buttons after

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions