-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[Web] Disable onPointerMove
on hover on gestures other than Hover
#3727
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
Conversation
import KeyboardEventManager from './KeyboardEventManager'; | ||
import WheelEventManager from './WheelEventManager'; | ||
import { tagMessage } from '../../utils'; | ||
import HoverGestureHandler from '../handlers/HoverGestureHandler'; |
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.
Can we handle that in another way (like a method or property)?
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.
Sure, we can after #3729 is merged 😅
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.
It's merged 🎉
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.
Right, I've changed it in ba1ac1b 😅
packages/react-native-gesture-handler/src/web/tools/GestureHandlerWebDelegate.ts
Outdated
Show resolved
Hide resolved
Correct me if I am wrong, but shouldn't |
tl;dr This PR doesn't disable |
Description
I've noticed that
onPointerMove
callback is triggered on each gesture, even if correct button is not pressed. Though events are not send, it still means that handlers do unnecessary work under the hood. This PR changesPointerEventManager
so that it doesn't triggeronPointerMove
callback without active pointer on gestures other thanHover
Test plan
Tested on example app with
console.log
added intoonPointerMove
inPanGestureHandler