https://github.com/dieterholvoet/event-propagation-path
Polyfill for the JavaScript Event path/composedPath property
https://github.com/dieterholvoet/event-propagation-path
javascript polyfill
Last synced: 2 months ago
JSON representation
Polyfill for the JavaScript Event path/composedPath property
- Host: GitHub
- URL: https://github.com/dieterholvoet/event-propagation-path
- Owner: DieterHolvoet
- License: mit
- Created: 2017-04-04T14:19:02.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-30T20:57:36.000Z (about 5 years ago)
- Last Synced: 2025-03-01T01:23:33.888Z (3 months ago)
- Topics: javascript, polyfill
- Language: JavaScript
- Size: 7.81 KB
- Stars: 16
- Watchers: 2
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# event-propagation-path
Polyfill for the JavaScript Event path/composedPath property ([related Stack Overflow thread](http://stackoverflow.com/a/39245638/2637528))## Usage
Call the `propagationPath` method on any Event object.## Example
```
window.addEventListener('click', (event) => {
if (!event.propagationPath().includes(this.container)) {
this.container.classList.remove('expanded');
}return false;
};);
```