Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support double tap to open (or ref/manual open) #78

Open
tsalama opened this issue Mar 22, 2023 · 10 comments
Open

Support double tap to open (or ref/manual open) #78

tsalama opened this issue Mar 22, 2023 · 10 comments

Comments

@tsalama
Copy link

tsalama commented Mar 22, 2023

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!

@tsalama
Copy link
Author

tsalama commented Apr 3, 2023

@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.

@mpiannucci
Copy link
Owner

mpiannucci commented Apr 4, 2023

Let me look into it. It's probably possible on android but not sure if the api on iOS. Added to my list

@mrousavy
Copy link
Contributor

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.

@mpiannucci
Copy link
Owner

Yeah I like exposing the method to open and the double tap. I'll try and take a stab this weekend :)

@mrousavy
Copy link
Contributor

king 👑

@mpiannucci
Copy link
Owner

So it is not supported by iOS directly to trigger the menu programmatically, as I feared. Can be hacked around tho probs

@mpiannucci
Copy link
Owner

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.

@mrousavy
Copy link
Contributor

Yea I understand that motivation, let's keep it simple! :) thanks

@rogerkerse
Copy link

So programmatic open is not possible right now through any hack either?

@mpiannucci
Copy link
Owner

Correct, it is not supported via iOS native API so it will not be supported here until it is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants