-
Notifications
You must be signed in to change notification settings - Fork 24.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
W3CPointerEvents: transform coordinates appropriately for cancel even…
…ts (#36967) Summary: Pull Request resolved: #36967 Changelog: [Internal] - W3CPointerEvents: transform coordinates appropriately for cancel events This change updates the behavior of pointer cancel events on Android to fire on the correct target. In particular: 1. Transform motion event from child frame into root frame before processing 2. Zero-out coordinates on pointer cancel event in frame of target before dispatching This is specifically necessary for cancel events due to the way they're propagated between views: we fire a cancel event when a child view starts handling a native gesture (e.g. a scroll view starts being scrolled). However, the native gesture event (MotionEvent) is in the frame of the child view, whereas the rest of the existing pointer event code expects events to be in the frame of the react root view. We don't have to do this conversion for other events since the corresponding MotionEvents are received directly by the root view. Reviewed By: lunaleaps Differential Revision: D45064308 fbshipit-source-id: f21d260f6aeb85e5d0efd53a48da6dd1e7b5efbc
- Loading branch information
1 parent
679c5b3
commit d0b97a8
Showing
2 changed files
with
89 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters