Skip to content

Commit cdf0c6b

Browse files
committed
use document
1 parent 64b2210 commit cdf0c6b

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ export function retryIfBlockedOn(
537537

538538
if (enableFormActions) {
539539
// Check the document if there are any queued form actions.
540-
const root = unblocked.ownerDocument;
540+
const root = unblocked === document ? unblocked : unblocked.ownerDocument;
541541
const formReplayingQueue: void | FormReplayingQueue = (root: any)
542542
.$$reactFormReplay;
543543
if (formReplayingQueue != null) {

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

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ 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-
// In practice, this is just the same as document but we might support shadow trees
200-
// in the future.
201-
const root = form.ownerDocument;
199+
const root = form === document ? form : form.ownerDocument;
202200
(root['$$reactFormReplay'] = root['$$reactFormReplay'] || []).push(
203201
form,
204202
submitter,

0 commit comments

Comments
 (0)