mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-26 22:20:19 +00:00
fix bug with dynamic nodes after fragments (#591)
This commit is contained in:
parent
b51abd1a9c
commit
020c4bf0f8
1 changed files with 8 additions and 2 deletions
|
@ -78,7 +78,6 @@ class Template {
|
|||
this.template_id = template_id;
|
||||
this.id = id;
|
||||
this.template = document.createElement("template");
|
||||
this.reconstructingRefrencesIndex = null;
|
||||
}
|
||||
|
||||
finalize(roots) {
|
||||
|
@ -123,7 +122,14 @@ class Template {
|
|||
for (let node = template.firstChild; node != null; node = node.nextSibling) {
|
||||
roots.push(node);
|
||||
}
|
||||
return new TemplateRef(template, this.dynamicNodePaths, roots, id);
|
||||
let ref = new TemplateRef(template, this.dynamicNodePaths, roots, id);
|
||||
// resolve ids for any nodes that can change
|
||||
for (let i = 0; i < this.dynamicNodePaths.length; i++) {
|
||||
if (this.dynamicNodePaths[i]) {
|
||||
ref.build(i);
|
||||
}
|
||||
}
|
||||
return ref;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue