Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Remove findInstanceBlockingEvent unused parameters (#26534)"
Browse files Browse the repository at this point in the history
This reverts commit d5fd60f.
kassens committed Apr 17, 2023

Verified

This commit was signed with the committer’s verified signature.
snyk-bot Snyk bot
1 parent cb3fb01 commit 682e67e
Showing 2 changed files with 22 additions and 3 deletions.
17 changes: 15 additions & 2 deletions packages/react-dom-bindings/src/events/ReactDOMEventListener.js
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -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(

0 comments on commit 682e67e

Please sign in to comment.