nandorojo / zeego

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

Delay on ContextMenu onSelect #80

Open wilkinsonj opened 3 months ago

wilkinsonj commented 3 months ago

Hello,

I have a ContextMenu with a couple of ContextMenu.Items, and when I click one, the 'onSelect' event occurs around 1 second later. This is quite a noticeable lag from a user experience point of view.

Am I missing something to avoid this?

Also, the ContextMenu.Trigger with action 'press' does nothing on Press on iOS

Thanks

nandorojo commented 3 months ago

Never seen that happen. Can’t help without seeing all the code

wilkinsonj commented 3 months ago

The root onOpenWillChange fires immediately, and if I set shouldDismissMenuOnSelect to false, the onSelect works immediately.

Clearly, the delay is the closing down of the contextmenu, the event must be fired after that has happened. Will try to reproduce.

For info, it's a large-ish picture (200kb) within the trigger.

Will try to create a minimum reproduction

nandorojo commented 3 months ago

It may be a bug with the upstream iOS menu library in this case

nandorojo commented 3 months ago

I'm wondering if this prop could fix it:

shouldWaitForMenuToHideBeforeFiringOnPressMenuItem

 __unsafeIosProps={{
      shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}
wilkinsonj commented 3 months ago

Sounds likely! Will test it tonight / tomorrow in my code and feed back

ahmadtech199 commented 3 months ago

https://github.com/nandorojo/zeego/assets/51687546/80ea8693-256a-4c0a-a00c-42542159f4fe

The ContextMenu.Trigger with action 'press' does nothing on Press on iOS "zeego": "^1.9.1"

nandorojo commented 3 months ago

Please open a new issue, that's unrelated.

Peek-A-Booo commented 2 months ago

I'm wondering if this prop could fix it:

shouldWaitForMenuToHideBeforeFiringOnPressMenuItem

 __unsafeIosProps={{
      shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}

it works