components icon indicating copy to clipboard operation
components copied to clipboard

feat(CdkMenu/CdkContextMenuTriggerFor): Allow CdkMenu to be programmatically opened/closed

Open shhdharmen opened this issue 1 year ago • 0 comments
trafficstars

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 avatar May 20 '24 05:05 shhdharmen