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

[feat] Send an event or run a callback when a context menu is dismissed #161

Open
tauri-bot opened this issue Mar 11, 2024 · 0 comments
Open

Comments

@tauri-bot
Copy link

This issue has been upstreamed from tauri-apps/tauri#9138

Describe the problem

In tauri 2.0, I'm opening a context menu using the new window.popup_menu() API. I can respond to selections by listening to menu events. However, I would also like to know when the user exits the menu without picking any items.

Describe the solution you'd like

A MenuEvent sent to the existing handler would be fine - perhaps popup_menu() could take an id parameter? Alternatives include adding more functions, like popup_with_dismiss_callback().

Alternatives considered

No response

Additional context

The reason I want to know when the menu is dismissed is because when the context menu opens, I modify the UI to highlight the element that the user has clicked on - I want to remove that highlight when they stop viewing the menu, even if they didn't make a selection

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