-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cancel pending hover on mouse exit #14533
base: master
Are you sure you want to change the base?
Conversation
If the mouse exits before the HoverService has rendered its pop-up, cancel the pending presentation of that pop-up. Fixes eclipse-theia#14532 Signed-off-by: Christian W. Damus <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this change!
I found one edge/case issue: When switching fast and often between two hoverable elements, I sometimes can reproduce that no more tooltip appears although I'm hovering an element. Once the mouse leaves and enters again the tooltip will reappear.
The behavior is better than the status quo with the weird delayed tooltips, so I would be fine with a merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I noticed one more issue:
Previously it was possible to be quick enough to enter the tooltip with the mouse to copy its contents. This is no longer possible.
- Is this a worthwhile feature?
- Do we want to keep it?
In this Gif we can see the current state of master
with the
- weird delay of tooltips showing although the element is no longer hovered
- the ability to enter and copy the tooltip content
@tsmaeder any preference on your side for today's release and/or followups? |
I don't think this is a critical problem, so let's not force it in if it's not ready. |
I'm certainly not in such a hurry, so I wouldn't ask for it to make this release 😀
This is something that I actually do quite a lot in other tools (some don't support selection in tool-tips, others do). I think I should be able to preserve this capability with a judicious sprinkling of debounces or similar. I'll give it a go. |
Implement a brief hysteresis also on the dismissal of the hover pop-up on mouse movement out of the target element so that (a) the user has an opportunity to mouse over the pop-up itself to interact with it, clicking links, hitting buttons, copying text (b) not dismiss the pop-up until the mouse pointer stops moving (helps accessibility for those with pointer accuracy challenges) The previous commit also had a misunderstanding of the the disposable returned by the DisposableCollection::push() method, that it would also dispose the original disposable, but it doesn't. Reworking disposable management fixed other issues in which transitioning to another hover target sometimes would not pop up. Signed-off-by: Christian W. Damus <[email protected]>
Commit ecf3c2d restores mouse pointer access to the hover pop-up itself and also fixes other glitches. |
What it does
If the mouse exits before the HoverService has rendered its pop-up, cancel the pending presentation of that pop-up.
Fixes #14532.
How to test
Pass the mouse pointer quickly over items in the status bar that provide hover pop-ups. See that those pop-ups do not appear when the mouse pointer has already gone elsewhere. Verify that the pop-up behaves as before when the mouse pointer lingers on the target element. Both cases as captured here in a screen recording:
Follow-ups
None.
Review checklist
Reminder for reviewers