Repository navigation
Description
Steps to reproduce
Add a tooltip to a list of vertically stacked widgets which are 32x32 or about the size of the average desktop toolbar. Hover one of the items so that the tooltip shows up. Try to hover the item below, you won't be able to if your mouse lands on the tooltip because hovering the tooltip will keep the tooltip on screen.
Expected results
When tooltips are displayed by hovering, they should be wrapped in ignorePointer: true, or if there is a good reason not to do this always, there should be an option ignorePointer on the tooltip widget. Tooltips should not get in the way of hovering other widgets. Compare to tooltips in chrome or somewhere else. This is not usually how tooltips work and it currently makes them unusable on desktop when they overlap other widgets that might need to be hovered.
Actual results
Tooltips get in the way of hovering other widgets.
Code sample
n/a
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
n/a
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsIssue closed with comment
Activity
darshankawar commentedon Jan 30, 2024
@jezell
Can you try by passing
showDuration: Duration.zeroas mentioned in this issue and check if it helps to resolve your issue ?If not, can you provide us a runnable code sample that shows the current behavior you are seeing ?
jezell commentedon Jan 30, 2024
@darshankawar That doesn't work because the mouse can move to the tooltip before the zero duration check. Reproducable on dartpad with the code below. If you move your mouse on top of the tooltip, the tooltip will never go away:
[-]Tooltip should ignore pointer[/-][+]Tooltips get in the way of hovering other widgets on web and desktop platforms.[/+]darshankawar commentedon Jan 31, 2024
Thanks for the feedback and reproducible code sample. The behavior is visible on web and desktop platforms as shown below:
142465.mov
stable, master flutter doctor -v
6 remaining items
jezell commentedon Feb 1, 2024
@HansMuller the key is whether the tap or the hover triggered the tooltip, not whether there was a hover. It's a bit weird that there isn't a hover "mode" but desktop is always hover mode, which is probably just wrong if you actually want rich tooltips on desktop:
https://api.flutter.dev/flutter/material/TooltipTriggerMode.html
I think appropriate solution is probably a "hover" mode being added to the enum, hover being the default on desktop and web only if unspecified, but allowed to be overridden, and ignorePointer being implied by mode = hover.
ignorePointer option on the tooltip would also solve the problem, but this kind of points to a larger issue with rich tooltips that might need a mode option to really solve.
npateras commentedon Jul 5, 2024
That does sound much better actually
Trung15010802 commentedon Jul 16, 2024
any solution?
benji-farquhar commentedon Jan 8, 2025
It’s valid to have rich tooltips triggered by hovering. Trigger mode, the type of message (plain or rich), and whether pointer events are ignored are all orthogonal concerns. For example, it’s reasonable to want to ignore pointer events even on rich content, especially if the content is purely decorative (e.g., styled text or icons without interactive elements).
The simplest solution is to provide an ignorePointer flag, giving developers the flexibility to choose the desired behavior based on their use case.
I've done a POC with IgnorePointer that works. I can probably refine and do a PR soon.
Support ignoring pointer events on tooltip overlay (#142465) (#161363)
huycozy commentedon Mar 5, 2025
Thanks for the report, @jezell!
This was fixed by #161363 and is available on the latest Flutter beta, master channels so please switch to these channels and retry.
Demo screenshot/video
Screen.Recording.2025-03-05.at.15.47.20.mov
flutter doctor -v
I'll close this issue as fixed on the latest channels. The fix should be landed on stable channel.
github-actions commentedon Mar 19, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.