Fix onPress handler mapping on web elements#1187
Fix onPress handler mapping on web elements#1187msand merged 1 commit intosoftware-mansion:developfrom
Conversation
|
Great, thanks for this. You can remove the note from the changelog, it's created automatically, I should update the pr template not to include it in instructions. Additionally, could you check that there's no onClick property from before? In case someone has different event handlers for web and native, then it would be better not to override the existing web handler. |
50ed4a5 to
704094c
Compare
|
For sure, I made the changes you requested. Should we try to map other web events? |
|
Looks good for now, can make another pr if more handlers are needed. Thanks! |
|
🎉 This PR is included in version 9.13.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
|
View has onLayout, but it looks like SVG components do not? Where should I look for adding that support? |
Summary
So onPress handlers are not working on web elements like
<Path />. I've noticed that because I am creating a graph inreact-native-svgthat works on all platforms and I needed the onPress functionality on a Path element. I've searched for some issues and saw that others are suffering the same problem:onPressclick on Rect #1078I think that this problems are related to this line that validates if the prop name is a valid prop for touchables on the web so what I did (to be as simple as possible) is to map the
onPresshandler toonClickhandler on the web. Only impacts the web implementation.Test Plan
What's required for testing (prerequisites)?
No prerequisites.
What are the steps to reproduce (after prerequisites)?
Draw a simple
<Path />element and add some onPress handler on the web.Compatibility
Checklist
README.md(N/A)CHANGELOG.mdexample/App.js) (N/A)