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

Menu show/hide/cancel events are not fired for ContextMenuButton #98

Open
finallyblueskies opened this issue Mar 18, 2024 · 1 comment

Comments

@finallyblueskies
Copy link

<ContextMenuButton
  onMenuWillShow={() => {
    console.log("Show");
  }}
  onMenuWillHide={() => {
    console.log("Hide?");
  }}
  onMenuWillCancel={() => {
    console.log("Cancel");
  }}
  //...
>
  {/* ... */}
</ContextMenuButton>

I am finding that none of the events above (or any of the did/will show/hide/cancel events) are being fired as the menu is opened and closed.

This is my first time touching Swift code but I was able to discern that where the ContextMenuView UIContextMenuInteractionDelegate (RNIContextMenuView+UIContextMenuInteractionDelegate+.swift) functions were called when that menu opened/closed (and respective event callbacks were called) this does not happen for the ContextMenuButton equivalent (RNIContextMenuButton+UIContextMenuInteractionDelegate.swift). I was unable to make this work.

@finallyblueskies finallyblueskies changed the title onMenuWillShow et al are not fired for ContextMenuButton Menu show/hide/cancel events are not fired for ContextMenuButton Mar 18, 2024
@finallyblueskies
Copy link
Author

The React ContextMenuButton component seems to be completely detached from the underlying menu state, the class state menuVisible value for example never reflects the real state of the menu.

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

1 participant