-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
locationX of touch events calculated differently for Android and iOS with new architecture of react native [expo 52] #2567
Comments
Noticing the same issue. @raphael-ott were you able to find a solution? |
Hi @CaptainJeff, |
I think i figured out a solution last night. So it seems like it now calculates the Path
Where |
Thanks @CaptainJeff for the insights into your approach. The isPointinFill option is a nice idea. Nevertheless, it is currently too much effort for me to rebuild in this direction, because my svg construct is rather complex. And i would also like to avoid using two different approaches for iOS and Android here.. But I will definitely keep it in my mind if there is no fix for this problem in the future! |
Description
I have added an onPress eventhandler to a Circle element, which should determine the current x position of the circle in relation to the surrounding Svg element when it is clicked:
<Svg><Circle r={50} cx={100} cy={100} onPress={(e) => { alert(e.nativeEvent.locationX); }}/></Svg>
Before upgrading to Expo 52 with react-native 0.76.3 (new arch enabled) everything worked fine. When I clicked the Circle the locationX was calculated relatively to the surrounding Svg. In the example above it would have prompted me with "100" when clicked in the center of the Circle both on iOS and Android. Now with the new arch of react native enabled it is promting "50" on iOS, which is not what I am expecting. On Android it still works fine with the expected value of "100".
Steps to reproduce
Snack or a link to a repository
https://snack.expo.dev/@raphael.ott/svg-locationx
SVG version
15.8.0
React Native version
0.76.3
Platforms
Android, iOS
JavaScript runtime
None
Workflow
Expo Go
Architecture
Fabric (New Architecture)
Build type
Debug app & production bundle
Device
iOS simulator
Device model
iPhone 16 Pro
Acknowledgements
Yes
The text was updated successfully, but these errors were encountered: