Skip to content

feat(aria/menu): Menu Trigger data #32782

@stephenlautier

Description

@stephenlautier

Feature Description

Currently aria menu doesn't seem to allow passing context data to the template from the trigger e.g. same trigger data as cdkMenuTriggerData
Not sure if this feature is in scope, or can be done otherwise better

Use Case

The idea is to share the same menu within a loop, however passing the item in context e.g.

@for (item of collection; track item.id) {
	<button ngMenuTrigger #origin #trigger="ngMenuTrigger" [menu]="formatMenu()" [menuData]="item">Open Menu</button>
}
<div ngMenu class="menu" #formatMenu="ngMenu">
    <ng-template ngMenuContent let-item="item">
        <div ngMenuItem value="Mark as read" (click)="markAsRead(item)">
            <span class="icon material-symbols-outlined" translate="no" aria-hidden="true">mark_email_read</span>
            <span class="label">Mark as read</span>
        </div>
    </ng-template>
</div>

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: aria/menufeatureLabel used to distinguish feature request from other issues

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions