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

Function getEventTarget

packages/core/src/animation/utils.ts:313–317  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

311
312/** Gets the target of an event while accounting for Shadow DOM. */
313export function getEventTarget<T extends EventTarget>(event: Event): T | null {
314 // If an event is bound outside the Shadow DOM, the `event.target` will
315 // point to the shadow root so we have to use `composedPath` instead.
316 return (event.composedPath ? event.composedPath()[0] : event.target) as T | null;
317}
318
319/**
320 * Determines if the animation or transition event is currently the expected longest animation

Callers 5

handleEnterAnimationEndFunction · 0.90
enterAnimationEndFunction · 0.90
handleOutAnimationEndFunction · 0.90
isLongestAnimationFunction · 0.85

Calls 1

composedPathMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…