polyfills icon indicating copy to clipboard operation
polyfills copied to clipboard

document.addEventListener and document.dispatchEvent do not work on document in IE11 with shadydom

Open pakaufmann opened this issue 5 years ago • 1 comments

Description

When shadydom is used custom events fired onto document do not work:

Example:

// never gets event
document.addEventListener('my-custom-event', function(e) { 
console.log(e) 
})

document.dispatchEvent(new CustomEvent('my-custom-event', {bubbles: true, detail: 'payload'})

Firing the event on a DOM-Node however does work:

// gets and logs event
document.getElementById("top").addEventListener('my-custom-event', function(e) { 
console.log(e) 
})

document.getElementById("top").dispatchEvent(new CustomEvent('my-custom-event', {bubbles: true, detail: 'payload'})

Expected behavior

Firing the custom event on document does work.

Actual behavior

Firing of the custom event on the document does not work, firing on any DOM-Node however works.

Version

webcomponents: 2.5.0 shadydom: 1.80

Browsers affected

  • [ ] Chrome
  • [ ] Firefox
  • [ ] Edge
  • [ ] Safari
  • [X] IE 11

pakaufmann avatar Nov 10 '20 16:11 pakaufmann

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 10 '21 21:11 stale[bot]