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(CdkMenu/CdkContextMenuTriggerFor): Allow CdkMenu to be programmatically opened/closed #29072

Open
shhdharmen opened this issue May 20, 2024 · 0 comments
Labels
area: cdk/menu feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@shhdharmen
Copy link

shhdharmen commented May 20, 2024

Feature Description

Current Behaviour

The directive CdkMenu is used with combination of CdkContextMenuTriggerFor. When user right-clicks (context-menu event), the menu gets opened and clicking on outside of the menu will close the menu.

New Feature Requested

It would be great if user can manually/programmatically open/close the menu. And also disable closing the menu clicking outside.

Possible Solutions

  1. Add a boolean input property cdkContextMenuDisableCloseOnOutsideClick - This will disable closing the CdkMenu on outside click
  2. Add an event emitter property cdkContextMenuTriggered - This will emit everytime user right-clicks (context-menu event) with the coordinates
  3. Add an event emitter property cdkContextMenuClickedOutside - This will emit everytime user clicks outside of the CdkMenu

Use Case

This will allow users to handle animations with CdkMenu if they want to apply on open/close.

@shhdharmen shhdharmen added feature This issue represents a new feature or feature request rather than a bug or bug fix needs triage This issue needs to be triaged by the team labels May 20, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/menu and removed needs triage This issue needs to be triaged by the team labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/menu feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

2 participants