You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The handleEvent DOM implementation doesn't work properly. In the following example the simple click log gets called 100 times while the object handler implementation none.
const{ GlobalRegistrator }=require('@happy-dom/global-registrator')constlog=console.log.bind(console)GlobalRegistrator.register()consthandler={handleEvent(event){this[event.type](event);}}constdiv=document.createElement('div')div.addEventListener('click',handler)div.addEventListener('mouseup',handler)div.addEventListener('click',()=>log('simple click'))div.addEventListener('mouseup',()=>log('simple mouseup'))handler.click=()=>log('click from handler')handler.mouseup=()=>log('mouse up from handler')div.dispatchEvent(newEvent('click'))div.dispatchEvent(newEvent('mouseup'))log('end')
Expected behavior
The DOM events should be properly fired only once
Device:
OS: Linux and Mac
Version 12.10.3
The text was updated successfully, but these errors were encountered:
Describe the bug
The
handleEvent
DOM implementation doesn't work properly. In the following example the simple click log gets called 100 times while the object handler implementation none.To Reproduce
Run this code or check it online
Expected behavior
The DOM events should be properly fired only once
Device:
The text was updated successfully, but these errors were encountered: