Last active
March 3, 2021 13:46
-
-
Save pinkhominid/fd4b13fc7db6a34812cf281e96ee2673 to your computer and use it in GitHub Desktop.
browser event path find target match
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function eventPathFindTargetMatch(event, selector) { | |
return event.composedPath().find(target => target.matches?.(selector)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment