1.0.5 • Published 6 years ago

event-propagation-path v1.0.5

Weekly downloads
1,515
License
ISC
Repository
github
Last release
6 years ago

event-propagation-path

Polyfill for the JavaScript Event path/composedPath property (related Stack Overflow thread)

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;
};);