fix replacing fragments

This commit is contained in:
Evan Almloff committed 2024-01-19 19:23:01 -06:00
1 parent 85c7c22619
commit b53ba7b5c7
3 files changed
+10 -7

No files matched your search

+2 -2
View File
@@ -284,8 +284,8 @@ impl VirtualDom {
// create the new children afresh.
if shared_keys.is_empty() {
if !old.is_empty() {
self.remove_nodes(to, &old[1..], None);
old[0].replace(new, parent, self, to);
let m = self.create_children(to, new, parent);
self.remove_nodes(to, old, Some(m));
} else {
// I think this is wrong - why are we appending?
// only valid of the if there are no trailing elements