nandorojo / zeego

Menus for React (Native) done right.
https://zeego.dev
MIT License
1.42k stars 41 forks source link

Question: Two Previews or Two Separate Context Menus #89

Open ChristopherGabba opened 1 week ago

ChristopherGabba commented 1 week ago

Hello Fernando,

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

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

nandorojo commented 1 week ago

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 commented 1 week ago

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 commented 1 week ago

@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 commented 1 week ago

@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