Handles the cases where the user hovers over the trigger.
()
| 206 | |
| 207 | /** Handles the cases where the user hovers over the trigger. */ |
| 208 | private _handleHover() { |
| 209 | // Subscribe to changes in the hovered item in order to toggle the panel. |
| 210 | if (this.triggersSubmenu() && this._parentMaterialMenu) { |
| 211 | this._hoverSubscription = this._parentMaterialMenu._hovered().subscribe(active => { |
| 212 | if ( |
| 213 | active === this._menuItemInstance && |
| 214 | !active.disabled && |
| 215 | // Ignore hover events if the parent menu is in the process of being closed (see #31956). |
| 216 | this._parentMaterialMenu?._panelAnimationState !== 'void' |
| 217 | ) { |
| 218 | this._openedBy = 'mouse'; |
| 219 | // Open the menu, but do NOT auto-focus on first item when just hovering. |
| 220 | // When VoiceOver is enabled, this is particularly confusing as the focus will |
| 221 | // cause another hover event, and continue opening sub-menus without interaction. |
| 222 | this._openMenu(false); |
| 223 | } |
| 224 | }); |
| 225 | } |
| 226 | } |
| 227 | } |
no test coverage detected