question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS: onPress is not working on the SVG Path

See original GitHub issue

Bug

I’ve created the following sample.

arc-bug

This is an arc which is rendered as per my expectations. When I press anywhere on the arc, on Android, onPress is always called properly but on iOS, sometimes onPress is called but sometimes it doesn’t. Some part of the arc is not clickable on iOS.

Also, there isn’t any positioning element(absolute/relative positioned) overlapping the arc.

Environment info

react-native: 0.61.5 react-native-svg: 9.13.3

Reproducible sample code

I’m using Path to show an elliptical arc as follows.

<Svg
   height={deviceHeight - 200}
   width={deviceWidth}
>
    <Path
       ref={ref => this.pathRef = ref}
       fill="none"
       stroke='rgba(214,51,51,.2)'
       strokeWidth={35}
       onPress={() => console.log('path on pressed called!')}
       d="M 392.72727272727275 124.90909090909088 A 360 450 0 0 0 42.72727272727275 574.9090909090909"
    />
</Svg>

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10

github_iconTop GitHub Comments

4reactions
stale[bot]commented, Jun 8, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. You may also mark this issue as a “discussion” and I will leave this open.

2reactions
aprilmintacpinedacommented, Nov 16, 2020

Still not working as of today…

Read more comments on GitHub >

github_iconTop Results From Across the Web

onPress is not working on the SVG Path on iOS using react ...
In react-native-svg, you can use the "Symbol" component it will group all the elements into a single element and then add onPress() to...
Read more >
iOS: onPress is not working on the SVG Path · Issue #1256
When I press anywhere on the arc, on Android, onPress is always called properly but on iOS, sometimes onPress is called but sometimes...
Read more >
Onpress Is Not Working On the Svg Path On Ios Using ... - ADocLib
Hello.I was experiencing the same issue android part of the app mostly works but I was having issues with my iOS side.The following...
Read more >
onPress is not working on the SVG Path on iOS using react ...
Coding example for the question onPress is not working on the SVG Path on iOS using react-native-svg-React Native.
Read more >
react-native-svg - npm
react-native init CleanProject cd CleanProject/ yarn add react-native-svg cd ios && pod install && cd .. Make a reproduction of the problem in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found