Revert "Remove findInstanceBlockingEvent unused parameters (#26534)"

This reverts commit d5fd60f7e6.
This commit is contained in:
Jan Kassens
2023-04-17 16:24:35 -04:00
parent cb3fb01cc3
commit 682e67edd4
2 changed files with 22 additions and 3 deletions
@@ -155,7 +155,12 @@ export function dispatchEvent(
return;
}
let blockedOn = findInstanceBlockingEvent(nativeEvent);
let blockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent,
);
if (blockedOn === null) {
dispatchEventForPluginEventSystem(
domEventName,
@@ -193,7 +198,12 @@ export function dispatchEvent(
if (fiber !== null) {
attemptSynchronousHydration(fiber);
}
const nextBlockedOn = findInstanceBlockingEvent(nativeEvent);
const nextBlockedOn = findInstanceBlockingEvent(
domEventName,
eventSystemFlags,
targetContainer,
nativeEvent,
);
if (nextBlockedOn === null) {
dispatchEventForPluginEventSystem(
domEventName,
@@ -230,6 +240,9 @@ export let return_targetInst: null | Fiber = null;
// Returns a SuspenseInstance or Container if it's blocked.
// The return_targetInst field above is conceptually part of the return value.
export function findInstanceBlockingEvent(
domEventName: DOMEventName,
eventSystemFlags: EventSystemFlags,
targetContainer: EventTarget,
nativeEvent: AnyNativeEvent,
): null | Container | SuspenseInstance {
// TODO: Warn if _enabled is false.
@@ -376,7 +376,13 @@ function attemptReplayContinuousQueuedEvent(
}
const targetContainers = queuedEvent.targetContainers;
while (targetContainers.length > 0) {
const nextBlockedOn = findInstanceBlockingEvent(queuedEvent.nativeEvent);
const targetContainer = targetContainers[0];
const nextBlockedOn = findInstanceBlockingEvent(
queuedEvent.domEventName,
queuedEvent.eventSystemFlags,
targetContainer,
queuedEvent.nativeEvent,
);
if (nextBlockedOn === null) {
const nativeEvent = queuedEvent.nativeEvent;
const nativeEventClone = new nativeEvent.constructor(