Skip to content

Hide ToolTip on Esc - #357

Merged
devmount merged 1 commit into
mainfrom
bugs/355-tooltip-a11y-improvements
Nov 13, 2026
Merged

devmount merged 1 commit into
mainfrom
bugs/355-tooltip-a11y-improvements

Conversation

@devmount

Copy link
Copy Markdown
Collaborator

What changed?

An open ToolTip can now be closed with pressing Escape. Tooltips forced open with visible: true ignore that.

Why?

The tooltip could only be hidden by moving the pointer or focus away, which violates WCAG 2.1 SC 1.4.13 (Content on Hover or Focus) and the ARIA APG tooltip pattern.

Limitations and Notes

Any focusout or mouseleave resets the dismissal, so with several focusable elements inside one anchor, tabbing between them shows the tooltip again, and moving only the pointer away while the trigger stays focused does as well. Escape is not stopped from propagating, so enclosing components (e.g. AppDrawer) still receive it.

Applicable Issues

Closes #355

QA Log

  • Added unit tests for Escape on the trigger, other keys, reset on mouseleave/focusout, document-level Escape only while hovered and visible: true
  • Ran component tests, type check and eslint successfully

Screenshots

No UI change

@devmount devmount self-assigned this Nov 13, 2026

@rwood-moz rwood-moz 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.

  • Pulled the branch locally
  • Ran the component tests, all passed included the updated ✓ unit test/components/ToolTip.test.js (15 tests) 39ms
  • Started storybook, verified an open ToolTip is closed when press ESC, except Tooltips with visible: true

@devmount
devmount merged commit 3ae10b6 into main Nov 13, 2026
5 checks passed
@devmount
devmount deleted the bugs/355-tooltip-a11y-improvements branch November 13, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ToolTip cannot be dismissed with Escape (WCAG 1.4.13)

2 participants