Skip to content

Commit

Permalink
unblocked may not === document
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Feb 22, 2024
1 parent cdf0c6b commit fab2702
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,8 @@ export function retryIfBlockedOn(

if (enableFormActions) {
// Check the document if there are any queued form actions.
const root = unblocked === document ? unblocked : unblocked.ownerDocument;
// If there's no ownerDocument, then this is the document.
const root = unblocked.ownerDocument || unblocked;
const formReplayingQueue: void | FormReplayingQueue = (root: any)
.$$reactFormReplay;
if (formReplayingQueue != null) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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

0 comments on commit fab2702

Please sign in to comment.