Skip to content

Commit a6f8886

Browse files
committed
unblocked may not === document
1 parent cdf0c6b commit a6f8886

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,8 @@ export function retryIfBlockedOn(
537537

538538
if (enableFormActions) {
539539
// Check the document if there are any queued form actions.
540-
const root = unblocked === document ? unblocked : unblocked.ownerDocument;
540+
// If there's no ownerDocument, then this is the document.
541+
const root = unblocked.ownerDocument || unblocked;
541542
const formReplayingQueue: void | FormReplayingQueue = (root: any)
542543
.$$reactFormReplay;
543544
if (formReplayingQueue != null) {

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ export function listenToFormSubmissionsForReplaying() {
196196
// javascript: URL placeholder value. So we might not be the first to declare it.
197197
// We attach it to the form's root node, which is the shared environment context
198198
// where we preserve sequencing and where we'll pick it up from during hydration.
199-
const root = form === document ? form : form.ownerDocument;
199+
// If there's no ownerDocument, then this is the document.
200+
const root = form.ownerDocument || form;
200201
(root['$$reactFormReplay'] = root['$$reactFormReplay'] || []).push(
201202
form,
202203
submitter,

0 commit comments

Comments
 (0)