MCPcopy Index your code
hub / github.com/angular/components / _subscribeToMouseEnter

Method _subscribeToMouseEnter

src/cdk/menu/menu-trigger.ts:230–254  ·  view source on GitHub ↗

* Subscribe to the mouseenter events and close any sibling menu items if this element is moused * into.

()

Source from the content-addressed store, hash-verified

228 * into.
229 */
230 private _subscribeToMouseEnter() {
231 this._cleanupMouseenter = this._ngZone.runOutsideAngular(() => {
232 return this._renderer.listen(this._elementRef.nativeElement, 'mouseenter', () => {
233 if (
234 // Skip fake `mouseenter` events dispatched by touch devices.
235 this._inputModalityDetector.mostRecentModality !== 'touch' &&
236 !this.menuStack.isEmpty() &&
237 !this.isOpen()
238 ) {
239 // Closes any sibling menu items and opens the menu associated with this trigger.
240 const toggleMenus = () =>
241 this._ngZone.run(() => {
242 this._closeSiblingTriggers();
243 this.open();
244 });
245
246 if (this._menuAim) {
247 this._menuAim.toggle(toggleMenus);
248 } else {
249 toggleMenus();
250 }
251 }
252 });
253 });
254 }
255
256 /** Close out any sibling menu trigger menus. */
257 private _closeSiblingTriggers() {

Callers 1

constructorMethod · 0.95

Calls 4

listenMethod · 0.80
toggleMethod · 0.65
isEmptyMethod · 0.45
isOpenMethod · 0.45

Tested by

no test coverage detected