MCPcopy Index your code
hub / github.com/angular/angular / isMouseSpecialEvent

Function isMouseSpecialEvent

packages/core/primitives/event-dispatch/src/event.ts:388–399  ·  view source on GitHub ↗
(e: Event, type: string, element: Element)

Source from the content-addressed store, hash-verified

386 * @return True if the event is a mouseenter/mouseleave event.
387 */
388export function isMouseSpecialEvent(e: Event, type: string, element: Element): boolean {
389 // `relatedTarget` is an old DOM API.
390 const related = (e as any).relatedTarget as Node;
391
392 return (
393 ((e.type === EventType.MOUSEOVER && type === EventType.MOUSEENTER) ||
394 (e.type === EventType.MOUSEOUT && type === EventType.MOUSELEAVE) ||
395 (e.type === EventType.POINTEROVER && type === EventType.POINTERENTER) ||
396 (e.type === EventType.POINTEROUT && type === EventType.POINTERLEAVE)) &&
397 (!related || (related !== element && !element.contains(related)))
398 );
399}
400
401/**
402 * Creates a new EventLike object for a mouseenter/mouseleave event that's

Callers

nothing calls this directly

Calls 1

containsMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…