react-native-context-menu-view
react-native-context-menu-view copied to clipboard
Support double tap to open (or ref/manual open)
Hello,
Thanks a lot for this library, it's been a pleasure to use.
With that, I'd like to request support for a doubleTapToOpen prop or something similar to support opening the context menu using a double tap similar to iMessage/WhatsApp.
If over-complicated, it would be great to at least have support for a ref that allows us to manually trigger the menu to open and write the double tap logic ourselves.
Thank you!
@mpiannucci Hey man, thanks for the library. Just curious if you have any ideas for this one. Would be awesome to be able to have a ref.triggerContextMenu() or something along those lines!
Thanks again.
Let me look into it. It's probably possible on android but not sure if the api on iOS. Added to my list
Heyo - this is pretty dope, I think it's possible on iOS! The react-native-context-menu lib from dominic also has this - but I think this lib is cleaner, would be cool to also have that option here.
Yeah I like exposing the method to open and the double tap. I'll try and take a stab this weekend :)
king 👑
So it is not supported by iOS directly to trigger the menu programmatically, as I feared. Can be hacked around tho probs
Kind of a hack, but a simple solution is using event propagation to limit the event tracking of the context menu from the child.
https://react.dev/learn/responding-to-events#stopping-propagation
The other library does some crazy logic to have this functionality and I'm not sure I want to introduce the same amount of complexity. This libraries biggest strength is its simplicity to me.
Yea I understand that motivation, let's keep it simple! :) thanks