Skip to content

Commit 2e56cd7

Browse files
committed
fix
1 parent 051f4ec commit 2e56cd7

File tree

1 file changed

+9
-2
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+9
-2
lines changed

packages/svelte/src/internal/client/dom/blocks/html.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import * as w from '../../warnings.js';
88
import { hash, sanitize_location } from '../../../../utils.js';
99
import { DEV } from 'esm-env';
1010
import { dev_current_component_function } from '../../context.js';
11-
import { get_first_child, get_next_sibling } from '../operations.js';
11+
import { create_text, get_first_child, get_next_sibling } from '../operations.js';
1212
import { active_effect } from '../../runtime.js';
1313
import { COMMENT_NODE } from '#client/constants';
1414

@@ -86,7 +86,14 @@ export function html(node, get_value, svg = false, mathml = false, skip_warning
8686
}
8787

8888
assign_nodes(hydrate_node, last);
89-
anchor = set_hydrate_node(next);
89+
90+
// in some cases the anchor could be in a fragment, and will be off-screen
91+
// when we re-render. TODO figure out how this happens (appears to be
92+
// forking-related) and come up with a regression test
93+
anchor = create_text();
94+
next.before(anchor);
95+
96+
set_hydrate_node(next);
9097
return;
9198
}
9299

0 commit comments

Comments
 (0)