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

Question: Two Previews or Two Separate Context Menus #89

Open
ChristopherGabba opened this issue Jun 20, 2024 · 6 comments
Open

Question: Two Previews or Two Separate Context Menus #89

ChristopherGabba opened this issue Jun 20, 2024 · 6 comments

Comments

@ChristopherGabba
Copy link

ChristopherGabba commented Jun 20, 2024

Hello Fernando,

I'm trying to build a "dual" context menu of sorts and I have two options:

  • Press and hold on an image and one menu opens below and a seperate context menu opens off to the right, or
  • Press and hold on an image and one menu opens below and a separate view opens off ot he right of the image (i.e. a second ContextMenu.Preview)

I'm struggling to get this working. How could I have two separate menus on one preview?

@nandorojo
Copy link
Owner

two context menus is not supported nor allowed by native APIs. Consider use a Group + Label if you want to. Or nested menus.

Another (iOS-only) option is to use the Auxiliary view to render an arbitrary view, however it won’t work for a full context menu. But perhaps you have things like message reactions or something that could go there?

@nandorojo
Copy link
Owner

The Auxiliary is a bit finicky. I’ll try to post some props that make it work. The RN ios context menu we use has some props in their examples that make it work too

@ChristopherGabba
Copy link
Author

ChristopherGabba commented Jun 20, 2024

@nandorojo Yeah the Auxilliary view would work if it didn't act that finicky. The iOS message emoji is similar to what I'm trying to accomplish (i.e. separate options)

IMG_89C99F35F084-1

Here is the exact goal, but I could get away with turning the text at the top into a separate context menu as well. Sounds like that is not possible:

Screenshot 2024-06-20 at 8 32 45 AM

@ChristopherGabba
Copy link
Author

ChristopherGabba commented Jun 21, 2024

@nandorojo The Auxiliary view actually is doing exactly what I want it to. I didn't see this thing in the Docs anywhere. I do agree though it's a little finicky but appears to be working well for the most part...
Screenshot 2024-06-21 at 7 36 28 AM

@andreasbroch2
Copy link

This was exactly what i was looking for. I don't know if you don't think it's ready, but I would suggest adding it to the docs.

I was trying to modify the preview to do both reactions and preview which is not easy, before finding this. This works so much better!

Thank you for this great tool!

@nandorojo
Copy link
Owner

Oh, yeah I should add that to the docs. Anyone down to PR?

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

3 participants