Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nativeEvent locationY is always equal to pageY #418

Closed
penx opened this issue May 25, 2020 · 4 comments
Closed

nativeEvent locationY is always equal to pageY #418

penx opened this issue May 25, 2020 · 4 comments
Labels

Comments

@penx
Copy link

penx commented May 25, 2020

Environment

  1. react-native -v: 0.62.2
  2. npm ls react-native-macos: react-native-macos@0.61.37
  3. node -v: v12.14.1
  4. npm -v: 6.13.4
  5. yarn --version: 1.21.1
  6. xcodebuild -version: Xcode 11.5, Build version 11E608c

Issue

Event objects have a property 'nativeEvent' which have properties 'locationY', 'pageY'.

My understanding is that pageY should be the y coordinate of where the user clicked relative to the app window, wheras locationY is relative to the current component.

However, at the moment, react-native-macos seems to be reporting locationY and pageY to be equal to each other.

Steps to Reproduce

  1. Create a new project,
  2. add several buttons to a page, logging locationY and pageY when a user clicks
  3. Click on the buttons and observe logs
const App = () => {
  return (
    <>
        
        <Button title="Hi" onPress={e => console.log(e.nativeEvent.locationY, e.nativeEvent.pageY)} />
        <Button title="Hi" onPress={e => console.log(e.nativeEvent.locationY, e.nativeEvent.pageY)} />
        <Button title="Hi" onPress={e => console.log(e.nativeEvent.locationY, e.nativeEvent.pageY)} />
    </>
  );
};

Expected Behavior

I would expect locationY to differ from pageY on the 2nd and 3rd button

Actual Behavior

locationY and pageY are always the same

@ghost ghost added the Needs: Triage 🔍 label May 25, 2020
@chrisglein
Copy link
Member

Link to the synthetic touch events didn't resolve for me: Looks like they are in the 0.62 docs but not 0.63, so I assume they were deprecated. Since macOS is on 0.62 that doesn't mean much... but it does mean that if they're slated to go away then you may want to move off of it now?

@NickGerleman did this come up in the Windows merges to 0.63?
@kikisaints do you know what the story is for synthetic-touch-events and if there was an intentional replacement?

@github-actions
Copy link

github-actions bot commented Jun 8, 2022

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Jun 8, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 7 days with no activity.

@christophpurrer
Copy link

This issue should have been fixed by #1288

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

No branches or pull requests

3 participants