Skip to content

ezhik1/event-propagation-path

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Polyfill for the JavaScript Event path/composedPath property

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%