Repository navigation
Introduce exitDuration to Tooltip for mouse pointer devices - #138321
auto-submit[bot] merged 12 commits into
Conversation
|
Looks like |
I think showDuration makes more sense there since that line only schedules a dismiss timer when there is no hovering pointer keeping the tooltip visible. |
@gspencergoog I have updated the test. It was coupled to the old behaviour. |
|
auto label is removed for flutter/flutter/138321, due to - The status or check suite Mac customer_testing has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
@gspencergoog Looks like it's failing checks now. Do I need to do anything? |
|
I don't think it has anything to do with your change. I've merged changes from the base branch, but the tree is broken at the moment anyhow, so we'll wait until it is green and try it again. |

This PR introduces a new property
exitDurationto Tooltip, the counterpart towaitDuration. The need for this is shown by #136586. This changes the behaviour ofshowDurationon mouse pointer devices. This is because the use cases for the current behaviour on touch screen devices vs mouse pointer devices is fundamentally different.Demo: tooltip with showDuration set
Tooltip disappears after 100 ms when moving away the mouse. Tooltip will not disappear when hovered.
chrome_J5Wz6XoF3s.mp4
Currently, when
showDurationis set, this adjusts the time it takes for the tooltip to hide after a mouse pointer has left the tooltip. This is not the same use case as its effect on touch screen devices, where it dictates how long the tooltip stays on screen after a long press. That is needed because the tooltip takes up screen space and there is not an intuitive way to hide it, whereas when using a mouse users expect to simply have to hover somewhere else. Having the tooltip stay around will look broken.Thus, this PR splits the two use cases.
showDurationno longer affects mouse pointer devices at all*. There is a precedent for such mouse pointer-only behaviour inwaitDuration. Instead, I have split up the two use cases and created the new propertyexitDuration, which will still allow for tweaking the time it takes for the tooltip to hide after the user has moved their mouse pointer somewhere else.*Note: Should
showDurationaffect this line?Fixes #136586.
Note: I noticed that when I made the change, no tests were broken. Hopefully, the tests added here help that in the future. I also noticed that in the existing tests, the
waitDurationtests contain assertions that implicate that it is the role ofwaitDurationto change this behaviour, but that's not currently (nor in the new behaviour) true, so I have fixed those tests.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.