-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Closed
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Description
Feature Description
The description of MenuTrigger says:
The
ngMenuTriggerdirective is used to open and close menus. It can be applied to any interactive element (e.g., a button)...
But in the reality the selector is bound to the button element making it cumbersome to use with custom button components.
@Directive({
selector: 'button[ngMenuTrigger]',
exportAs: 'ngMenuTrigger',
....
})
https://github.com/angular/components/blob/main/src/aria/menu/menu-trigger.ts#L44
Use Case
In our case we have a need to trigger the menu using different elements in our design system fx. our custom button component. The current selector requires us to have a button around our button fx:
<button ngMenuTrigger>
<lm-button/>
</button>
It causes a focus trap as our custom button is always focusable and ngMenuTrigger forces the wrapping button to also be focusable.
Metadata
Metadata
Assignees
Labels
P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentAn issue that is relevant to core functions, but does not impede progress. Important, but not urgent