nandorojo / zeego

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

Function execution delay in menu items #33

Closed thecoorum closed 1 year ago

thecoorum commented 1 year ago

Hey! First of all thank you for amazing lib! While using it I noticed a delay between item press and function execution both in ContextMenu and DropdownMenu Item component's onSelect prop, this delay is absent with onPress prop for ContextMenu's Preview component for the same function though

nandorojo commented 1 year ago

That's interesting. I haven't experienced that, or at least noticed it. What's the delay exactly?

thecoorum commented 1 year ago

I recorded a video demonstration where I'm performing the same operation but from different places. See the crossed eye icon appearing with a delay while using drop-down menu

https://user-images.githubusercontent.com/32096016/209629324-3b0f975c-2188-4c81-be54-e63c8c0c8747.MOV

nandorojo commented 1 year ago

Is it possible it's your animation? Could you try an alert when the menu item is selected?

thecoorum commented 1 year ago

Hey @nandorojo! Sorry for the delay, I tested out with Alert.alert and seems to be there is small delay when using dropdown menu instead of context one. Attaching the video

https://user-images.githubusercontent.com/32096016/216073650-552ad1fa-13d0-45b4-a29c-a6a8fded28f8.mp4

nandorojo commented 1 year ago

To clarify, the delay happens for context, but not for dropdown, right? I think this must be something from the upstream iOS library, because there is no divergence from Zeego's behavior between the two.

thecoorum commented 1 year ago

Got ya, thanks!