Skip to content

[A11y]: WithTooltip is not accessible #32249

@Sidnioulz

Description

@Sidnioulz

Describe the bug

All components that use WithTooltip to produce a menu/listbox/popup with interactive components are inaccessible, because WithTooltip closes when attempting to focus into the menu. This is an implementation side effect of the "close on click outside" feature of the underlying library.

We need to switch to something else (react-aria could be a good fit? they have a hook specifically for this) so we can have close on click outside without this buggy behaviour.

Then, we also want to show tooltips on focus rather than just on hover (in most cases). This is necessary to provide the same level of information to users with motor disabilities.

Note: this issue isn't about making every use of tooltips WCAG compliant. Tooltips are often used as-in in Storybook when a listbox, menu or dialog role and related keyboard focus trapping should be implemented.

Reproduction link

yarn storybook:ui

Reproduction steps

  1. Focus to a button that uses a tooltip for a menu
  2. Try to get into the menu without using your mouse

System

n/a, 9.2.0 alpha

Additional context

No response

Metadata

Metadata

Assignees

Labels

a11y: keyboardAccessibility issues related to keyboard navigation or shortcutsaccessibilitybugui

Type

No type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions