Repository navigation
Conversation
germanocaumo
approved these changes
Nov 11, 2026
germanocaumo
left a comment
Contributor
There was a problem hiding this comment.
Checked BBButton (default and circle), BBBAccordion and BBBAvatar in Chromium, Firefox and WebKit: Escape hides the tooltip on hover and focus, focus stays, it comes back on the next hover or focus, and the listener is removed on hide and unmount. BBBSlider's value label doesn't close on Escape either; it could join the Checkbox/Toggle follow-up.
A BBButton tooltip shown on hover or keyboard focus can only be closed by moving the pointer away or moving focus elsewhere. It can cover nearby content, and WCAG 1.4.13 (Content on Hover or Focus) requires such content to be dismissible without moving the pointer or focus. Add a shared Tippy plugin, `hideOnEsc`, that hides the tooltip when Escape is pressed, and pass it to the button's Tippy. The `keydown` listener is added to the document only while the tooltip is shown and removed when it hides or is destroyed. The tooltip shows again on the next hover or focus. The plugin lives in `src/utils/tooltip.ts` so every component with a Tippy tooltip can use it. The listener runs in the capture phase, so the tooltip also hides when an Escape is stopped before it reaches the document, as react-modal does for BBBModal with `shouldCloseOnEsc`, or by a focused input that handles it. The event itself is not stopped: stopping it would hide it from the consumer's own handlers while a tooltip is shown.
The header tooltip of BBBAccordion can only be closed by moving the pointer away or moving focus elsewhere, which falls short of WCAG 1.4.13 (Content on Hover or Focus). Pass the shared `hideOnEsc` plugin to its Tippy, as BBButton does, so Escape hides the tooltip.
The name tooltip of BBBAvatar can only be closed by moving the pointer away, which falls short of WCAG 1.4.13 (Content on Hover or Focus). Pass the shared `hideOnEsc` plugin to its Tippy, as BBButton does, so Escape hides the tooltip.
The tooltip of BBBCheckbox can only be closed by moving the pointer away or moving focus elsewhere, which falls short of WCAG 1.4.13 (Content on Hover or Focus). Pass the shared `hideOnEsc` plugin to its Tippy, as BBButton does, so Escape hides the tooltip.
The tooltip of BBBToggle can only be closed by moving the pointer away or moving focus elsewhere, which falls short of WCAG 1.4.13 (Content on Hover or Focus). Pass the shared `hideOnEsc` plugin to its Tippy, as BBButton does, so Escape hides the tooltip.
The value label of BBBSlider, shown on hover, focus or drag when
`valueLabelDisplay` is 'auto', can only be closed by moving the
pointer away or moving focus elsewhere, which falls short of WCAG
1.4.13 (Content on Hover or Focus).
MUI's Slider renders the label and keeps its open state internal,
with no Escape handling, so the shared `hideOnEsc` Tippy plugin
cannot be used. Render the label through a `valueLabel` slot that
closes it on Escape and opens it again on the next hover or focus.
As in `hideOnEsc`, the listener is added to the document in the
capture phase only while the label is open, and the event is not
stopped. A label shown at all times ('on') is not hover content and
stays. A consumer's own `slots.valueLabel` still takes precedence.
Arthurk12
force-pushed
the
fix/tooltip-escape
branch
from
November 13, 2026 23:52
116807c to
c6fd2f9
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Tooltips on
BBButton,BBBAccordionandBBBAvatarnow close when Escape is pressed, without moving the pointer or focus.tooltipLabeltooltip ofBBButtonandBBBAccordionand the name tooltip ofBBBAvatar.Motivation
A tooltip can cover nearby content, and the only way to close it is to move the pointer or focus away, which falls short of WCAG 1.4.13 (Content on Hover or Focus).
More
BBBCheckboxonce fix(BBBCheckbox): show keyboard focus and disabled state; add tooltip and helper text #117 is mergedBBBToggleonce fix(BBBToggle): show keyboard focus and disabled state; add tooltip #118 is merged