Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix (Pointer|Touch)Events not firing after drag and scroll for Scroll…
…View and HorizontalScrollView Summary: Changelog: [Android][Fixed] - Fix such that when the scrollviews call `onChildStartedNativeGesture`, they appropriately call `onChildEndedNativeGesture` to unlock the native gesture such that `JSTouchDispatcher` or `JSPointerDispatcher` will continue to emit events. ### How did we find this issue? As React Native is adding pointer event support for different input types, we noticed after pressing and dragging on a ScrollView, hover events would not fire. ### Why was this not an issue before? This was always an issue -- it was just that `JSTouchDispatcher` worked its way around it by explicitly setting `mChildIsHandlingNativeGesture = false` on a `ACTION_DOWN` event, [code pointer](https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSTouchDispatcher.java#L76). Similarly, `JSPointerDispatcher` [copied this logic](https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/uimanager/JSPointerDispatcher.java#L106). With new hover support in `JSPointerDispatcher` no similar workaround was put in (or even a good place to insert). ### What's next? * As a follow-up, we should look at removing this workaround (at least for `JSPointerDispatcher`) * By searching for usages of where we `notifyNativeGestureStarted`, it looks like `ReactDrawerLayout` and `ReactSwipeRefreshLayout` both do and don't call the symmetric `notifyNativeGestureEnded`. This will likely be an issue in the future (or maybe if we remove the workaround) Reviewed By: mdvacca Differential Revision: D37977982 fbshipit-source-id: 0d18767f4debbf24cfb24b54df1310f6f96a0d03
- Loading branch information