nandorojo / zeego

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

Open dropdown menu on long press #40

Closed arcln closed 1 year ago

arcln commented 1 year ago

Hello, is it possible to only open dropdown menu when long pressing the trigger? So I can have another behaviour when simply tapping.

nandorojo commented 1 year ago

Is the context menu what you want perhaps? That opens on long press.

arcln commented 1 year ago

On Android context menu does the job, on iOS context menu will blur the whole screen + show a preview but I have nothing to preview. Also, context menu on iOS have a delay (#33) which is annoying.

I'd like to use dropdown menu as it have the exact behaviour I want on iOS.

nandorojo commented 1 year ago

Just released 1.5.0 which adds this feature. Can you try it and let me know if it works? I didn't have time to test it but I think it should.

<DropdownMenu.Trigger action="longPress">
  <Text>Open</Text>
</DropdownMenu.Trigger>
arcln commented 1 year ago

Just tried it and it works perfectly. Thank you for the blazing fast support!

uyasarkocal commented 11 months ago

This feature does not work in the reversed scenario, which is my case:

<ContextMenu.Trigger action="press">
    <Text>Open</Text>
</ContextMenu.Trigger>

Used libraries:

"zeego": "^1.6.2"
"expo-dev-client": "~2.4.6"
"expo": "^49.0.0"
nandorojo commented 11 months ago

Thanks for flagging that, I would accept a PR with a fix.