Skip to content

Commit

Permalink
fix: update currenTarget via defineProperty. Fixes capricorn86#544 & c…
Browse files Browse the repository at this point in the history
  • Loading branch information
benbender committed Jul 18, 2022
1 parent ee69730 commit b4e5e23
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/happy-dom/src/event/EventTarget.ts
Expand Up @@ -50,7 +50,10 @@ export default abstract class EventTarget implements IEventTarget {
event.target = this;
}

event.currentTarget = this;
Object.defineProperty(event, "currentTarget", {
value: this,
writable: false
});

const onEventName = 'on' + event.type.toLowerCase();

Expand Down

0 comments on commit b4e5e23

Please sign in to comment.