Skip to content

Commit 3f4d5f6

Browse files
seabassopkozlowski-opensource
authored andcommitted
fix(platform-browser): Update pseudoevent created by createMouseSpecialEvent to populate _originalEvent property (#59690)
This fixes an internal bug. PR Close #59690
1 parent 093ba4b commit 3f4d5f6

File tree

1 file changed

+3
-1
lines changed
  • packages/core/primitives/event-dispatch/src

1 file changed

+3
-1
lines changed

packages/core/primitives/event-dispatch/src/event.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,8 @@ export function createMouseSpecialEvent(e: Event, target: Element): Event {
418418
// this event into a pseudo-real mouseenter/mouseleave event by adjusting
419419
// its type.
420420
//
421-
const copy: {-readonly [P in keyof Event]?: Event[P]} = {};
421+
const copy: {-readonly[P in keyof Event]?: Event[P]}&
422+
{'_originalEvent'?: Event} = {};
422423
for (const property in e) {
423424
if (property === 'srcElement' || property === 'target') {
424425
continue;
@@ -444,6 +445,7 @@ export function createMouseSpecialEvent(e: Event, target: Element): Event {
444445
}
445446
copy['target'] = copy['srcElement'] = target;
446447
copy['bubbles'] = false;
448+
copy['_originalEvent'] = e;
447449
return copy as Event;
448450
}
449451

0 commit comments

Comments
 (0)