-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Open
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: material/menu
Description
I updated @angular/material from 8.0.2 to 8.1.2 and my custom menu component stopped working with the keyboard.
The problem seems to be that in node_modules/@angular/material/esm2015/menu.js the addItem method is empty.
Version 8.1.2 node_modules/@angular/material/esm2015/menu.js
/*
* Registers a menu item with the menu.
* @docs-private
* @deprecated No longer being used. To be removed.
* @breaking-change 9.0.0
*/
/**
* @param {?} _item
* @return {?}
*/
addItem(_item) {}
Version 8.0.2 node_modules/@angular/material/esm2015/menu.js
addItem(_item) {
if (this._items.indexOf(item) === -1) {
this._items.push(item);
this._itemChanges.next(this._items);
}
}
The code below worked before updating to 8.1.2
// MenuComponent
@ViewChild('menu', { static: false }) menu: MatMenu;
@ContentChildren(MenuItemComponent) menuItems: QueryList<
MenuItemComponent
>;
@ContentChildren(MenuItemComponent) menuItems: QueryList<
MenuItemComponent
>;
this.menuItems.forEach(menuItem => {
this.menu.addItem(menuItem.matMenuItem);
});
// MenuItemComponent
@ViewChild(MatMenuItem, {static: false}) matMenuItem: MatMenuItem
-
Should the addItem method be empty? Is this a bug?
@breaking-change 9.0.0
sounds to me that the method should be remove for @angular/material 9.0.0 and not be empty for 8.1.2 -
How should I register my custom menu items instead?
Thanks!
dhacc and Clement-cvh
Metadata
Metadata
Assignees
Labels
P4A relatively minor issue that is not relevant to core functionsA relatively minor issue that is not relevant to core functionsarea: material/menu