Skip to content

Commit 629b255

Browse files
iterianiatscott
authored andcommitted
refactor(core): Add four tests and fix code to make tests pass. (angular#55747)
The first test asserts that bubbling does not work right now. The second asserts that stopPropagation works, which should pass when test #1 passes too. The third test asserts properties about the events passed to the event handler. THe fourth test asserts that mouse events do not translate to jsaction nor help emit the jsaction binary. This required a change in code to make this pass. PR Close angular#55747
1 parent ef029b8 commit 629b255

File tree

3 files changed

+331
-230
lines changed

3 files changed

+331
-230
lines changed

packages/core/src/hydration/event_replay.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,14 @@ export function collectDomEventsInfo(
142142
continue;
143143
}
144144
const name: string = firstParam;
145+
if (
146+
name === 'mouseenter' ||
147+
name === 'mouseleave' ||
148+
name === 'pointerenter' ||
149+
name === 'pointerleave'
150+
) {
151+
continue;
152+
}
145153
eventTypesToReplay.add(name);
146154
const listenerElement = unwrapRNode(lView[secondParam]) as any as Element;
147155
i++; // move the cursor to the next position (location of the listener idx)

packages/platform-server/src/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,6 @@ function insertEventRecordScript(
145145
const captureEventTypes = [];
146146
const eventTypes = [];
147147
for (const eventType of events) {
148-
if (
149-
eventType === 'mouseenter' ||
150-
eventType === 'mouseleave' ||
151-
eventType === 'pointerenter' ||
152-
eventType === 'pointerleave'
153-
) {
154-
continue;
155-
}
156148
if (
157149
eventType === 'focus' ||
158150
eventType === 'blur' ||

0 commit comments

Comments
 (0)