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

Method onMouseOver

src/aria/private/menu/menu.ts:226–259  ·  view source on GitHub ↗

Handles mouseover events for the menu.

(event: MouseEvent)

Source from the content-addressed store, hash-verified

224
225 /** Handles mouseover events for the menu. */
226 onMouseOver(event: MouseEvent) {
227 if (!this.visible()) {
228 return;
229 }
230
231 this.hasBeenHovered.set(true);
232 const item = this.inputs.items().find(i => i.element()?.contains(event.target as Node));
233
234 if (!item) {
235 return;
236 }
237
238 const parent = this.inputs.parent();
239 const activeItem = this?.inputs.activeItem();
240
241 if (parent instanceof MenuItemPattern) {
242 const grandparent = parent.inputs.parent();
243 if (grandparent instanceof MenuPattern) {
244 grandparent._clearTimeouts();
245 grandparent.listBehavior.goto(parent, {focusElement: false});
246 }
247 }
248
249 if (activeItem && activeItem !== item) {
250 this._closeItem(activeItem);
251 }
252
253 if (item.expanded()) {
254 this._clearCloseTimeout();
255 }
256
257 this._openItem(item);
258 this.listBehavior.goto(item, {focusElement: this.shouldFocus()});
259 }
260
261 /** Closes the specified menu item after a delay. */
262 private _closeItem(item: MenuItemPattern<V>) {

Callers 1

menu.spec.tsFile · 0.45

Calls 11

_closeItemMethod · 0.95
_clearCloseTimeoutMethod · 0.95
_openItemMethod · 0.95
visibleMethod · 0.80
setMethod · 0.80
parentMethod · 0.80
activeItemMethod · 0.80
_clearTimeoutsMethod · 0.80
expandedMethod · 0.80
elementMethod · 0.45
gotoMethod · 0.45

Tested by

no test coverage detected