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