Skip to content

Commit 682e67e

Browse files
committed
Revert "Remove findInstanceBlockingEvent unused parameters (facebook#26534)"
This reverts commit d5fd60f.
1 parent cb3fb01 commit 682e67e

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

packages/react-dom-bindings/src/events/ReactDOMEventListener.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,12 @@ export function dispatchEvent(
155155
return;
156156
}
157157

158-
let blockedOn = findInstanceBlockingEvent(nativeEvent);
158+
let blockedOn = findInstanceBlockingEvent(
159+
domEventName,
160+
eventSystemFlags,
161+
targetContainer,
162+
nativeEvent,
163+
);
159164
if (blockedOn === null) {
160165
dispatchEventForPluginEventSystem(
161166
domEventName,
@@ -193,7 +198,12 @@ export function dispatchEvent(
193198
if (fiber !== null) {
194199
attemptSynchronousHydration(fiber);
195200
}
196-
const nextBlockedOn = findInstanceBlockingEvent(nativeEvent);
201+
const nextBlockedOn = findInstanceBlockingEvent(
202+
domEventName,
203+
eventSystemFlags,
204+
targetContainer,
205+
nativeEvent,
206+
);
197207
if (nextBlockedOn === null) {
198208
dispatchEventForPluginEventSystem(
199209
domEventName,
@@ -230,6 +240,9 @@ export let return_targetInst: null | Fiber = null;
230240
// Returns a SuspenseInstance or Container if it's blocked.
231241
// The return_targetInst field above is conceptually part of the return value.
232242
export function findInstanceBlockingEvent(
243+
domEventName: DOMEventName,
244+
eventSystemFlags: EventSystemFlags,
245+
targetContainer: EventTarget,
233246
nativeEvent: AnyNativeEvent,
234247
): null | Container | SuspenseInstance {
235248
// TODO: Warn if _enabled is false.

packages/react-dom-bindings/src/events/ReactDOMEventReplaying.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,13 @@ function attemptReplayContinuousQueuedEvent(
376376
}
377377
const targetContainers = queuedEvent.targetContainers;
378378
while (targetContainers.length > 0) {
379-
const nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
379+
const targetContainer = targetContainers[0];
380+
const nextBlockedOn = findInstanceBlockingEvent(
381+
queuedEvent.domEventName,
382+
queuedEvent.eventSystemFlags,
383+
targetContainer,
384+
queuedEvent.nativeEvent,
385+
);
380386
if (nextBlockedOn === null) {
381387
const nativeEvent = queuedEvent.nativeEvent;
382388
const nativeEventClone = new nativeEvent.constructor(

0 commit comments

Comments
 (0)