Skip to content
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

Add a hover GestureRecognizer #33312

Closed
jmagman opened this issue May 24, 2019 · 13 comments · Fixed by #63834
Closed

Add a hover GestureRecognizer #33312

jmagman opened this issue May 24, 2019 · 13 comments · Fixed by #63834
Labels
a: mouse Issues related to using a mouse or mouse support c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.

Comments

@jmagman
Copy link
Member

jmagman commented May 24, 2019

Use case

The hover gesture is an important one on devices with mouse support, particularly when designing flutter for web. A HoverGestureRecognizer would make it easier, for example, to add a recognizer to a TextSpan.

Proposal

Create a GestureRecognizer HoverGestureRecognizer, similar to TapGestureRecognizer.

@DSenanayake
Copy link

Agreed!

@xxzj990
Copy link

xxzj990 commented May 31, 2019

I need it!!

@kenthinson
Copy link

Hover is already built in Listener()
However it seems to be broken on web. Not sure about other platforms as i did not test.

@DSenanayake
Copy link

@kenthinson yes, it's only working when you mouse down and enter.

@kenthinson
Copy link

@jmagman I have opened a issue to fix the bug. #33707
As it's not a feature request but rather a bug fix this one should be closed?

@jmagman
Copy link
Member Author

jmagman commented Jun 2, 2019

I still think it would be nice to have a built-in hover GestureRecognizer that can be used to create a TextSpan.

@jmagman jmagman added the framework flutter/packages/flutter repository. See also f: labels. label Jun 19, 2019
@dkwingsmt
Copy link
Contributor

dkwingsmt commented Nov 15, 2019

@jmagman Can you illustrate what you want to achieve by this addition that can't (easily) be done with MouseRegion.onHover (which used to be Listener.onHover when this issue was opened)? Only with a clear application can we start to discuss the best way to design a new API.

@aliyazdi75
Copy link

@dkwingsmt MouseRegion takes Widget child, and can't convert InlineSpan TextSpan to Widget. Is that right?

@dkwingsmt dkwingsmt added a: mouse Issues related to using a mouse or mouse support f: gestures flutter/packages/flutter/gestures repository. labels Jul 10, 2020
@pedromassangocode pedromassangocode added c: proposal A detailed proposal for a change to Flutter c: new feature Nothing broken; request for a new capability labels Jul 16, 2020
@karabanovbs
Copy link

Why closed? Is HoverGestureRecognizer already exist or how handle PointerHoverEvent on TextSpan?

@dkwingsmt
Copy link
Contributor

dkwingsmt commented Nov 6, 2020

Why closed? Is HoverGestureRecognizer already exist or how handle PointerHoverEvent on TextSpan?

All widgets now receive hover events. The gesture recognizer of TextSpan should receive hover events now (although I haven't specifically tested this one).

@karabanovbs
Copy link

@dkwingsmt Thank you for your answer! But i not understand how handle hover event on TextSpan. Can you help me? How i can write custom gesture recognizer for PointerHoverEvent?

@gsx123
Copy link

gsx123 commented Dec 10, 2020

I have same question about how to handle hover event on TextSpan.
Can any one show the demo code?

@github-actions
Copy link

github-actions bot commented Aug 4, 2021

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 -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: mouse Issues related to using a mouse or mouse support c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants