Files
react-native/packages/react-native/ReactAndroid
Vincent Riemer 63d9db891c Fix incorrect pointer coordinates caching (#39185)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39185

Changelog: [Internal] - Fix incorrect pointer coordinates caching

In D48472486 I moved the updating of "previous" fields into the `handleHitStateDivergence` method which made sense considering that it's run on every event regardless but what I didn't take into account was the updating of the `mLastEventCoordinatesByPointerId` field. On `ACTION_HOVER_MOVE` events there's a filter that ensures that only move events that have a large enough distance are emitted (something that isn't done on iOS, hence why I didn't think of it), but after my changes in D48472486 it was updating `mLastEventCoordinatesByPointerId` **before** that hover move check, making the distance always 0 and never firing move events.

This diff fixes this by moving the updating of `mLastEventCoordinatesByPointerId` and `mLastButtonState` back to the end of `handleMotionEvent`.

Reviewed By: lunaleaps

Differential Revision: D48756372

fbshipit-source-id: 6f2e40366986ce8d1c6128e49bf3abd44137196d
2023-08-28 17:49:10 -07:00
..

Building React Native for Android

See the Building from Source guide on the React Native website.

Running tests

When you submit a pull request CircleCI will automatically run all tests. To run tests locally, see Testing guide on the React Native website.