Repository navigation
Description
Summary
Tooltip resolves ignorePointer as widget.ignorePointer ?? _tooltipTheme.ignorePointer ?? widget.message != null (packages/material_ui/lib/src/tooltip.dart), so a plain-message tooltip is invisible to hit testing. On any mouse platform, when the tooltip does not overlap its trigger (true for every ≤48 px IconButton, including AppBar's BackButton and DrawerButton), moving the pointer from the trigger onto the tooltip fires the trigger's onExit, and RawTooltip dismisses it after exitDuration (100 ms).
WCAG 2.2 SC 1.4.13 Content on Hover or Focus (Level AA) — Hoverable: "If pointer hover can trigger the additional content, then the pointer can be moved over the additional content without the additional content disappearing." The only exception is content whose presentation is controlled by the user agent (e.g. HTML title); Flutter's tooltip is author-drawn, so it is in scope.
Verified with a widget test (material_ui @ 5d34573, flutter master): hover trigger → move pointer onto tooltip → pumpAndSettle → dwell 2 s:
ignorePointer |
40 px trigger (4 px gap) | 48 px trigger (0 px gap) | 200 px trigger (overlaps) |
|---|---|---|---|
null (default) |
dismissed | dismissed | stays (pointer never exits) |
true |
dismissed | dismissed | stays |
false |
stays, no flicker | stays, no flicker | stays, no flicker |
Same result for an AppBar BackButton on linux/macOS/windows: 40×40 button, tooltip box starts 4 px below it, tooltip dismissed on hover with the default.
History
- [Web]Tooltip widget meets accessibility standard #75885 → Make tooltip hoverable and dismissible #83830 (2021):
Tooltipwas deliberately made hoverable and dismissible for exactly this requirement. - Fixing richMessage gesture recognizer in tooltip widget #126207 (2023): overlay
IgnorePointerremoved sorichMessagegesture recognizers work. - Tooltips get in the way of hovering other widgets on web and desktop platforms. #142465 → Support ignoring pointer events on tooltip overlay (#142465) #161363 (Feb 2025): tooltips were blocking hover on neighbouring toolbar items; the fix added
ignorePointerdefaulting tomessage != null. Reviewed as "ok with this default behavior change"; neither the PR nor the issue mentions accessibility or [Web]Tooltip widget meets accessibility standard #75885. This is where hoverability for plain messages was lost. - Raw tooltip with smaller API surface that exposes tooltip widget #177678 (3.41) accidentally re-enabled hoverability; [flutter 3.41.0] Tooltip ignorePointer property not working #182468 reported that as a regression; Add RawTooltip.ignorePointer #182527 restored
ignorePointersemantics viaRawTooltip.ignorePointerand added a test asserting the tooltip disappears when hovered. The default was not revisited. - [material_ui] Improve Autocomplete, DrawerHeader, and Tooltip accessibility packages#12918 (material_ui 1.5.0) added
TooltipThemeData.ignorePointeras a global opt-in to hoverable plain tooltips. Default unchanged.
Impact
Six open VPAT findings against packages/material_ui/test_apps/a11y_assessments (web, Chrome/Firefox/Safari): #/date-picker, #/navigation-bar, #/check-box-list-tile, #/drawer, #/app-bar, #/navigation-drawer. Those are the routes the auditors sampled; the defect reproduces on any route with an AppBar back button, i.e. nearly all of them. Internal refs: b/463913706, b/463912499, b/463910116, b/463900105, b/462283112, b/462276641.
The assessment app sets no tooltipTheme. Setting TooltipThemeData(ignorePointer: false) there would make the VPAT pass while apps using the default keep failing, so I'd rather settle the default first.
The trade-off
Today "hoverable" means "opaque to hit testing": a hoverable tooltip blocks hover/click on whatever is beneath it (#142465, #161169) and blocks wheel scrolling when the cursor rests on it (#167042, #183878). Both scroll bugs were closed because of the ignorePointer: true default — #167042 was closed pointing at #161363 as the fix, and #183878 (P1) was the 3.41 regression that went away once #182527 restored ignorePointer. richMessage tooltips live with this already; message tooltips did too from 2021 to 2025. Flipping the default without changing hit-test behaviour re-opens those issues for plain messages, including the P1.
Options
A. Flip the default for message tooltips to ignorePointer: false, matching richMessage. Material UI for React does this ("Tooltips are interactive by default (to pass WCAG 2.2 Success Criterion 1.4.13)"). Opt-out: TooltipThemeData(ignorePointer: true) globally or ignorePointer: true per widget (note the theme value also applies to richMessage tooltips).
B. Hoverable and pass-through (preferred if it holds up): in RawTooltip._buildTooltipOverlay, keep the overlay MouseRegion for enter/exit but give it HitTestBehavior.translucent and put the content under IgnorePointer, so hovering keeps the tooltip alive while taps and scroll events reach the widgets beneath. That satisfies Hoverable without regressing #142465/#183878. It needs a RawTooltip change in flutter/flutter (team-framework) plus the material_ui default change; I have not prototyped it.
C. Keep the default. Then the six VPAT findings should be closed Won't Fix with that rationale, and the docs should state that Level AA requires TooltipThemeData(ignorePointer: false).
Notes for the decision
- No show/hide loop with
ignorePointer: false(verified above, including the overlapping case): enter/exit are tracked per device across trigger and overlay, and entering the overlay cancels the pending dismiss. This is the code path every tooltip used between Make tooltip hoverable and dismissible #83830 and Support ignoring pointer events on tooltip overlay (#142465) #161363. - Breaking-change policy: Tree-hygiene defines "breaking" as breaking flutter/tests customer tests (and now routes true breaking changes through an RFC); that gate is for flutter/flutter, and a tooltip default flip is unlikely to trip it — Support ignoring pointer events on tooltip overlay (#142465) #161363 landed the opposite flip as a plain default change. For material_ui the gate is the
pending_changelogsentry (minor), and the "Tooltip should disappear even if mouse is hovering over the tooltip overlay" test must be inverted. - Geometry: with desktop/web density an
IconButtonis 40 px and the defaultverticalOffset(24 from the trigger centre) leaves a 4 px gap between button and tooltip box; even withignorePointer: false, a pointer that pauses in the gap for longer thanexitDurationloses the tooltip (measured: 50 ms pause → stays, 300 ms pause → dismissed). Worth a look alongside A or B.
Open question for team-design: A, B, or C — and if B, whether the RawTooltip change should go through team-framework first.
Activity