Open soroushm opened 4 years ago
System:
OS: macOS 10.15.3
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 998.20 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.1 - /usr/local/bin/node
Yarn: 1.19.2 - /usr/local/bin/yarn
npm: 6.13.7 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google Play Intel x86 Atom
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.3/11C29 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
create-react-native-web-app: 0.1.14
@msand give me a favor and take a look at this
Can you provide a full repro / https://snack.expo.io/ ?
@msand yup sure it's the repo expo example on ios and web working very well also on expo android emulator working fin, but in actual device first one only working (use expo app on android)
@msand bro can you check it, please
That's quite a large reproduction, could you make it minimal / as small as possible while still demonstrating the issue? http://sscce.org/
@msand it's a short version 🍡 as possible with treeMap almost 3 components I will cut the treemap and. notify you here
@msand so i cut the shit out on same snack its pre much react-native-SVG
is left still the bug alive
and the difference is bug below up and completely onPress networking
https://snack.expo.io/@soroush_co/svg-tree
thank you so much for the support
Just to make sure. Have you tried this in a plain react-native project using the latest version of react-native-svg?
@msand yes it's "react-native-svg": "^12.0.3",
look like expo haven't latest version
@msand any update?
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.
Hey guys! Could you take a look at this issue?
I can reproduce the same issue on iOS. When G
elements are nested onPress is only working on the top level one.
need someone to take job done!
the community needs to grow up, I just migrate to View
and Text
Anyone found a workaround for this? We switched to using SVG to render a complex graphic and this is a release blocker.
@msand do you anticipate having time any time soon to work on this?
@georgiosd Workaround is to not use nested G
elements. Instead apply all the props directly to children.
another instance of the same bug can be found in this one #1460
For me worked by wrapping pie chart into Svg tag
It seems that viewBox size affects the touchable surface size on some Android devices, even if width and height is '100%'. Essential PH-1 - works, LG G5, Samsung S21. - doesn't (only middle top part of the SVG works) Android Emulator kinda works as the touchable surface is about 90% shorter on width and height in my case (left to right, top to bottom) iOS - works perfectly.
import Svg, { G, Image as SVGImage } from "react-native-svg";
<Svg
width="100%"
height="100%"
viewBox="0 0 10240 7680"
onPress={() => console.log("SVG press")}
>
<G>
<SVGImage
x="0"
y="0"
width="100%"
height="100%"
href={"some image url"}
onPress={() => console.log("SVGImage press")}
/>
</G>
</Svg>
SVG press - has no issues with touches on the entire surface. SVGImage press - has issues described above.
Solution: use onPressIn
instead of onPress
.
the problem is in android onPress on G element working only for first child but in IOS working very well that means in bellow image only for big square top left working
Each square is like this
"react-native-svg": "^11.0.1", "react-native": "0.61.5",