Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit fb3c3a1

Browse files
Googlernshahan
authored andcommitted
Trigger selected event when an item from sub-menu is selected
PiperOrigin-RevId: 187693693
1 parent 87d9351 commit fb3c3a1

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/material_menu/menu_item_groups.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,10 @@ class MenuItemGroupsComponent implements OnInit, OnDestroy {
224224
_subMenuOpener.cancel();
225225
}
226226

227+
void onSubMenuItemSelected(MenuItem item) {
228+
_selected.add(item);
229+
}
230+
227231
void select(MenuItem item, MenuItemGroup group) {
228232
item.nullAwareActionHandler();
229233

lib/material_menu/menu_item_groups.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
<menu-item-groups
9999
autoFocus
100100
[activateFirstItemOnInit]="isKeyboardOpenedSubmenu"
101+
(selected)="onSubMenuItemSelected($event)"
101102
[menu]="item.subMenu">
102103
</menu-item-groups>
103104
</material-list>

0 commit comments

Comments
 (0)