Skip to content

feat(material/menu): add support for context menu #31383

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

crisbeto
Copy link
Member

Adds the new MatContextMenuTrigger directive that allows users to mark an area as a trigger for a menu. When the user right-clicks inside of the area, the menu will be opened next to their pointer.

Fixes #5007.

crisbeto added 2 commits June 19, 2025 08:47
Moves most of the menu trigger logic into a base class so it can be reused for the context menu.
Adds the new `MatContextMenuTrigger` directive that allows users to mark an area as a trigger for a menu. When the user right-clicks inside of the area, the menu will be opened next to their pointer.

Fixes angular#5007.
@crisbeto crisbeto requested a review from andrewseguin June 19, 2025 07:36
@crisbeto crisbeto requested a review from a team as a code owner June 19, 2025 07:36
@crisbeto crisbeto requested review from wagnermaciel and removed request for a team June 19, 2025 07:36
@crisbeto crisbeto added the target: minor This PR is targeted for the next minor release label Jun 19, 2025
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: docs Related to the documentation area: material/menu labels Jun 19, 2025
@@ -6,97 +6,27 @@
* found in the LICENSE file at https://angular.dev/license
*/

import {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff in this file is large. It boils down to me moving the shared trigger logic into a base class so it can be reused.

@crisbeto crisbeto added the merge: preserve commits When the PR is merged, a rebase and merge should be performed label Jun 19, 2025
crisbeto added 2 commits June 19, 2025 10:27
Sets up a test harness for the context menu.
Sets up a live example showing how the context menu works.
@crisbeto crisbeto added docs: preview When applied, a preview of the documentation site is deployed to Firebase dev-app preview When applied, previews of the dev-app are deployed to Firebase and removed docs: preview When applied, a preview of the documentation site is deployed to Firebase labels Jun 19, 2025
Copy link

Deployed dev-app for eafd7bb to: https://ng-dev-previews-comp--pr-angular-components-31383-dev-21soxq81.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: docs Related to the documentation area: material/menu detected: feature PR contains a feature commit dev-app preview When applied, previews of the dev-app are deployed to Firebase merge: preserve commits When the PR is merged, a rebase and merge should be performed target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Right-click context menu
1 participant