* If the menu item is not disabled and the element does not have a menu trigger attached, emit * on the cdkMenuItemTriggered emitter and close all open menus. * @param options Options the configure how the item is triggered * - keepOpen: specifies that the menu should be kept open after t
(options?: {keepOpen: boolean})
| 128 | * - keepOpen: specifies that the menu should be kept open after triggering the item. |
| 129 | */ |
| 130 | trigger(options?: {keepOpen: boolean}) { |
| 131 | const {keepOpen} = {...options}; |
| 132 | if (!this.disabled && !this.hasMenu) { |
| 133 | this.triggered.next(); |
| 134 | if (!keepOpen) { |
| 135 | this._menuStack.closeAll({focusParentTrigger: true}); |
| 136 | } |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | /** Return true if this MenuItem has an attached menu and it is open. */ |
| 141 | isMenuOpen() { |
no test coverage detected