leecade / leecade/react-native-practice

[Android] onResponderMove nativeEvent locationX does not change

Open
#31 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

onPanResponderMove = (e, gestureState) => {
    let { locationX, locationY } = e.nativeEvent.changedTouches[0] // bug here

temporary fix:

if (Platform.OS === 'android') {

  // layout from onLayout
  locationX = e.nativeEvent.changedTouches[0].pageX - this.state.layout.pageX
  locationY = e.nativeEvent.changedTouches[0].pageY - this.state.layout.pageY
}

ref: https://github.com/facebook/react-native/blob/master/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/TouchesHelper.java#L60-L61

track: https://github.com/facebook/react-native/issues/7221

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked React Native TouchesHelper.java reference and tracked upstream issue #7221; the payload names no local files or tests in this repository. Confirm whether this repository is meant to reproduce or patch the upstream Android coordinate behavior, and define completion around locationX and locationY changing correctly without the temporary layout-based workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.