Comments (16)
I think I did it on iOS.
This will be released within the next major version.
I`ll feature out how to implement this on Android.
from react-native-svg.
So, I was able to attach a touch event to an component by wrapping it in touchablehighlight, however, what I need to do is to split up a larger SVG into sections and have each section be tappable. Is this possible?
from react-native-svg.
Could we get a discussion on this about HOW we might do this? I'd love to help figure out touch if we had an approach and maybe an MVP idea... Like maybe simple onPress events from the JS side which are supported on the backend bridged component around one shape type?! Thoughts???
from react-native-svg.
Its very difficult to attach touch events on current code.The Svg element is more like a canvas not a truly container for some shape elements. The shape elements inside Svg, like(Circle, Path etc..) are some kind of virtual nodes, they
re abstractions of the paint on the canvas.
For example
<Svg>
<Rect x="0" y="0" width="100" height="100" />
</Svg>
The Rect
element is just a virtual node. It wont layout itself, It just draw a rectangle on the Svg canvas context.So it
s very difficult to attach events on a node which is not existed on layout system.
But I`ll try my best to refactor whole library to support the touch events, thanks for the awesome suggestion anyway.
from react-native-svg.
Wow!!! Thank you, and let us know if you need any help. This could be a
game changer.
On Sat, May 14, 2016 at 3:50 AM, Horcrux [email protected] wrote:
I think I did it in iOS.
This will be released within the next major version.β
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#37 (comment)
Sean Hise
from react-native-svg.
OMG, throw some ideas at someone and watch them run! Even if my idea was just a βhey how could weβ, I never expected this.
iOS is the first step, so Iβm totally blown away. Very nice work Horcrux!
On May 14, 2016 at 4:35:55 AM, srhise ([email protected]) wrote:
Wow!!! Thank you, and let us know if you need any help. This could be a
game changer.
On Sat, May 14, 2016 at 3:50 AM, Horcrux [email protected] wrote:
I think I did it in iOS.
This will be released within the next major version.β
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#37 (comment)
Sean Hise
β
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
from react-native-svg.
The gesture responder system added in a new branch named touch-events
, which is not finished yet on Android.
Those handlers are supported
onMoveShouldSetResponder
onMoveShouldSetResponderCapture
onResponderGrant
onResponderMove
onResponderReject
onResponderRelease
onResponderTerminate
onResponderTerminationRequest
onStartShouldSetResponder
onStartShouldSetResponderCapture
Im planning to implement touchable handlers on some new elements like: TouchableCircle TouchableRect ...etc I
m not sure if this is a good idea to add those new elements
from react-native-svg.
I think this is great! And makes it a killer library. Keep on keeping on! π π―
from react-native-svg.
I don't know if this is possible, but the touch events I am trying to hook
to are 's
On Sun, May 15, 2016 at 8:36 AM, Cale Hoopes [email protected]
wrote:
I think this is great! And makes it a killer library. Keep on keeping on!
π π―β
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#37 (comment)
Sean Hise
from react-native-svg.
Can`t find a way to dispatch touch events to ReactShadowNode on Android.
Been working on this for days.
Any ideas?
from react-native-svg.
@kmagiera @mkonicek might know?
from react-native-svg.
Im closing this issue now, for the [gesture responder system](http://facebook.github.io/react-native/docs/gesture-responder-system.html#content) is shiped within
[email protected]`.
Feel free to reopen this issue.
from react-native-svg.
Wow, you did it!! I'll play around with it a bit as I think it would be good for us to update the docs with an example.
from react-native-svg.
The doc is out of date for ages.
But I`ll update the doc later.
And will add some examples for this.
from react-native-svg.
Does that mean I can use gesture fully to get items touch events for this library?
from react-native-svg.
Thanks I read through this but none the wiser on how to detect touch events on svg shapes - do I understand it correctly that react native gives you coordinates, but there's still no easy way to detect what shape those coordinates are on?
from react-native-svg.
Related Issues (20)
- toDataURL only works the second time it is executed in old Arch HOT 1
- [Invariant Violation: requireNativeComponent: "RNSVGSvgView" was not found in the UIManager. HOT 7
- onPress in Path don't works on iOS, on android works
- The onPress method in the Path component works on android but not on ios.
- Svg Image pointerEvents="none" not working on Android
- Invalid `RNSVG.podspec` file: undefined method `visionos' for #<Pod::Specification name="RNSVG">. HOT 11
- Invariant Violation: requireNativeComponent: "RNSVGPath" was not found in the UIManager. HOT 2
- Fatal Exception: java.lang.Error Invalid number formating character 'N'
- SvgUri can not load some of the svgs in both android and ios
- Animating the strokeDashArray prop of an animated Path crashes running on the Android Simulator
- <Text /> with PanResponder only works if you click exactly on the letters
- Failed parsing SvgCssUri for first time, after reopening app it appears
- Xlinkhref only work on web does not work on ios and android (the color did not get inherited ) HOT 2
- React native web + vitest issue - Cannot use import statement outside a module HOT 4
- fetchText method error : TypeError: Cannot read property 'prototype' of undefined when trying to call svg from uri
- HTML entities contained in an XML string are not decoded by the SvgXml component
- Path not rendering correctly
- How to center Text along a path?
- React Native SVG stroke-width bug on expo web.
- SVG image not import in React native
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-svg.