Skip to content
This repository has been archived by the owner on Nov 9, 2018. It is now read-only.

onPress handler on nodes #7

Open
egunsoma opened this issue Apr 2, 2018 · 3 comments
Open

onPress handler on nodes #7

egunsoma opened this issue Apr 2, 2018 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on

Comments

@egunsoma
Copy link

egunsoma commented Apr 2, 2018

Can I somehow attach onPress handlers to the svg tags? I want to change the color of the objects when the user touches it. (Some kind of coloring book). Is this possible?

@a-r-d
Copy link
Contributor

a-r-d commented Apr 5, 2018

Currently not possible, but I will take a PR if you want to add it!

@a-r-d a-r-d added enhancement New feature or request good first issue Good for newcomers labels Apr 5, 2018
@egunsoma
Copy link
Author

egunsoma commented Apr 5, 2018

I managed to solve it by traversing the parsed svgNode once. Since it's not change heavy component, this won't effect the performance of the rendering.

I'll see if I can come up with a solution for that. A good approach would be to add an extra config object, where you can specify several Predicate and Prop pairs, and if the Predicate returns truthy, the prop will be set for the given SVG node.

@a-r-d what do you think?

@a-r-d
Copy link
Contributor

a-r-d commented Aug 22, 2018

@egunsoma yes please make a PR

@bobschultz bobschultz added wontfix This will not be worked on and removed wontfix This will not be worked on labels Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request good first issue Good for newcomers wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants