Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide tooltips from screen readers with aria-hidden #974

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brichwin
Copy link

@brichwin brichwin commented Jan 16, 2025

Description of the Changes

Issue:
See Improve Screen Reader Users' Navigation Experience by Hiding Control Tooltips from Screen Readers #973

When using VoiceOver on controls using a playkit-js-ui tooltip, navigating through controls using VO-Left Arrow and VO-Right Arrow results in the VoiceOver cursor stopping on both the control button and also on the associated tooltip. This creates two issues:

  1. Inefficient Navigation: Users must press navigation keys twice as many times to move through the controls since they need to navigate past both the button and its tooltip.

  2. Potential User Confusion: When navigating quickly, users may be unsure whether they're focused on the actual control button or its tooltip, potentially leading to a confusing experience.

Here is a video demonstrating the issue:
Video: Improve VoiceOver Navigation Experience by Hiding Control Tooltips from Screen Readers (2:34)

Fix:
Add aria-hidden="true" to the tooltip component in src/components/tooltip/tooltip.tsx. This change:

  • Hides tooltip text from screen readers while maintaining visual tooltip functionality
  • Results in VoiceOver cursor only stopping on the actual control buttons
  • Creates a more streamlined navigation experience
return (
      <div
        className={style.tooltip}
        onMouseOver={this.onMouseOver}
        onMouseLeave={this.onMouseLeave}
        ref={el => (el ? (this.tooltipElement = el) : undefined)}>
        {children}
        <span aria-hidden="true" style={{maxWidth: props.maxWidth}} ref={el => (el ? (this.textElement = el) : undefined)} className={className.join(' ')}>
          {props.label}
        </span>
      </div>
    );

Sample video player with this fix applied: demo-with-aria-hidden-on-tooltip

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

Successfully merging this pull request may close these issues.

1 participant