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

Delay on ContextMenu onSelect #80

Open
wilkinsonj opened this issue Mar 7, 2024 · 10 comments
Open

Delay on ContextMenu onSelect #80

wilkinsonj opened this issue Mar 7, 2024 · 10 comments

Comments

@wilkinsonj
Copy link

wilkinsonj commented Mar 7, 2024

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
Copy link
Owner

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

@wilkinsonj
Copy link
Author

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
Copy link
Owner

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

@nandorojo
Copy link
Owner

I'm wondering if this prop could fix it:

shouldWaitForMenuToHideBeforeFiringOnPressMenuItem

 __unsafeIosProps={{
      shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}

@wilkinsonj
Copy link
Author

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

@ahmadtech199
Copy link

ahmadtech199 commented Mar 12, 2024

action.press.not.working_resized.mp4

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

@nandorojo
Copy link
Owner

Please open a new issue, that's unrelated.

@Peek-A-Booo
Copy link

I'm wondering if this prop could fix it:

shouldWaitForMenuToHideBeforeFiringOnPressMenuItem

 __unsafeIosProps={{
      shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}

it works

@RamiroG8k
Copy link

I'm wondering if this prop could fix it:

shouldWaitForMenuToHideBeforeFiringOnPressMenuItem

 __unsafeIosProps={{
      shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}

Just for context to anyone with the same issue and the error with the types as mentioned in this issue, it goes in the Root

<ContextMenu.Root
    __unsafeIosProps={{
        shouldWaitForMenuToHideBeforeFiringOnPressMenuItem: false
    }}
>

@nandorojo
Copy link
Owner

Wondering if we should just set this field by default in Zeego. Any reason not to?

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

5 participants