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

wrong onPressIn callback called when rendering a list of shapes and using a pencil/stylus! #2313

Closed
mgcrea opened this issue Jun 26, 2024 · 2 comments

Comments

@mgcrea
Copy link

mgcrea commented Jun 26, 2024

Description

I am encountering a strange intermittent bug that does not happen on every app start but when it happens it will trigger consistently during the lifecycle of the app, can only be triggered with a pencil/stylus (Apple Pencil)

I have a rect with resize anchors (eg. corner circles) that can be pressed, when pressed (using pressIn), I log the id of the pressed item.

On some app start I will have one pressIn every two that will incorrectly call the previous callback (so you get the same callback called twice whatever anchor you pressed) when taped with the Apple pencil, will work properly with a touch tap or a mouse.

Thought it might be a react bug but I can't reproduce it with similar code using plain Views (cf. the repro that has both side by side).

  • I am using keys and useCallback to prevent any ref issues.
  • The event.nativeEvent.locationX/locationY are correct even if the callback is wrong.
  • Initially thought it was a dev mode bug but reproduced the issue on a release build.

Tried to debug in Xcode with breakpoints but no luck for now (not my strong suit).

Happy to dig further if given guidance!

Steps to reproduce

  1. git clone --branch bug-react-native-svg-1 --single-branch https://github.com/mgcrea/react-native-reanimated-sandbox.git
  2. pnpm install; npx pod-install
  3. kill and restart the app until the buggy behaviour occurs (alternate between two anchors should be buggy and a warning should appear)

Snack or a link to a repository

https://github.com/mgcrea/react-native-reanimated-sandbox/tree/bug-react-native-svg-1

SVG version

15.3.0

React Native version

0.74.2

Platforms

iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Release app & dev bundle

Device

Real device

Device model

iPad Pro 13"

Acknowledgements

Yes

Copy link

github-actions bot commented Jun 26, 2024

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete React-native-svg version section.

@github-actions github-actions bot added the Missing info The user didn't precise the problem enough label Jun 26, 2024
@bohdanprog bohdanprog removed the Missing info The user didn't precise the problem enough label Jun 28, 2024
@mgcrea
Copy link
Author

mgcrea commented Jul 1, 2024

Tried to implement the behaviour with react-native-skia & gesture-handler to pinpoint the active element and got the same buggy behaviour, from what I can see the coordinates are actually wrong so it is probably a react-native bug. Will close this as I have reproduced it without RNSVG.

@mgcrea mgcrea closed this as completed Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants