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

ContextMenu trigger onclick too #59

Open
AlejandroGutierrezB opened this issue Sep 8, 2023 · 10 comments
Open

ContextMenu trigger onclick too #59

AlejandroGutierrezB opened this issue Sep 8, 2023 · 10 comments

Comments

@AlejandroGutierrezB
Copy link

trying this example https://github.com/nandorojo/zeego/blob/master/examples/expo/src/App.tsx

When I do a normal click on the contextMenu the dropdown is shown (with some delay).

Expected behaviour is for this not to happen

@rranjan14
Copy link

It's happening with me in android. Also, long press is not triggering context menu after first open.

@nandorojo
Copy link
Owner

Hi! Can you please clarify the problem and what the platform is @AlejandroGutierrezB? I don't have enough info here. Are you saying that tapping the menu opens the context menu when it should only be on long press? I assume this is Android?

@AlejandroGutierrezB
Copy link
Author

Hi! Can you please clarify the problem and what the platform is @AlejandroGutierrezB? I don't have enough info here. Are you saying that tapping the menu opens the context menu when it should only be on long press? I assume this is Android?

Hi @nandorojo sorry for not been detailed enough.

My issue is for Web, Haven't really tested in android so can't talk about that.

when clicking there is a small delay and the menu is triggered. That is the unexpected behaviour as I don't want to open the menu when clicking.
when long-clicking the menu is instantly triggered as expected.

@nandorojo
Copy link
Owner

context menu should open on right click. is that not what’s happening?

@Karthik-B-06
Copy link

Hey @nandorojo, using ContextMenu Menu on Android gets triggered onClick too. Here is a video showing what is happening.

VIDEO-2024-01-15-16-07-52.mp4

The Context.Trigger is also wrapped inside a LightBox component.

@ICGVIP
Copy link

ICGVIP commented Jun 11, 2024

Hey @nandorojo, using ContextMenu Menu on Android gets triggered onClick too. Here is a video showing what is happening.

VIDEO-2024-01-15-16-07-52.mp4

The Context.Trigger is also wrapped inside a LightBox component.

This is happening with me in iOS too. ContextMenu.Trigger wraps an entire component with different images in my case and long pressing any image, opens it (onPress gets fired basically) along with opening the context menu.

@AounNaqvi173
Copy link

found any solution to this problem ?

@nandorojo
Copy link
Owner

Hey guys, so on iOS, the context menu actually does have its own view…I think it’s fixed with style on root, which definitely isn’t right. Let me look into a way to change this. It’s a breaking change so it will be in v2.

@jonluca
Copy link

jonluca commented Dec 4, 2024

This is still happening in v2.0.4 - a long press works nicely in iOS, but on android a single tap will trigger the context menu. I thought potentially toggling the action prop would help, but it looks like its not typed and doesnt actually do anything.

@jstheoriginal
Copy link

I think the issue might happen when using react-native-gesture-library for touchables within this component. Since the gesture-library components can't really coordinate with the regular react native components, it fires since it doesn't know the child handled the touches.

Would there be any way to detect if rn-gesture-handler is being used and/or provide a way to provide the touchable class to use for the library itself?

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

8 participants