Skip to content

Conversation

m-bert
Copy link
Contributor

@m-bert m-bert commented Oct 1, 2025

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 changes PointerEventManager so that it doesn't trigger onPointerMove callback without active pointer on gestures other than Hover

Test plan

Tested on example app with console.log added into onPointerMove in PanGestureHandler

@m-bert m-bert requested review from j-piasecki and akwasniewski and removed request for j-piasecki October 1, 2025 14:39
import KeyboardEventManager from './KeyboardEventManager';
import WheelEventManager from './WheelEventManager';
import { tagMessage } from '../../utils';
import HoverGestureHandler from '../handlers/HoverGestureHandler';
Copy link
Member

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)?

Copy link
Contributor Author

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 😅

@akwasniewski
Copy link
Contributor

Correct me if I am wrong, but shouldn't onPointerMove be also triggered for ManualGestures?

@m-bert
Copy link
Contributor Author

m-bert commented Oct 7, 2025

Correct me if I am wrong, but shouldn't onPointerMove be also triggered for ManualGestures?

tl;dr
I don't think it is necessary to consider this.

This PR doesn't disable onPointerMove callbacks completely, but only if there's no active pointer on the given view. If we follow android implementation, you can see that the only method that Manual overrides is onHandle . Now, onHandle is called inside handle method in parent class. If you look into implementation, you'll see that first it checks for active pointers. So it will behave in the same way 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants