Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

event-propagation-path

DieterHolvoet2.4kISC1.0.5

Polyfill for the JavaScript Event path/composedPath property

event, path, composedPath, polyfill

readme

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