
Loading…
DOM API innerHTML adds only first element #1972
SmokyBob
commented
imskull
commented
I had similar problem, I solved it by adding Polymer.dom.flush() in the loop, may that works for you as well.
Owner
kevinpschaaf
commented
for (var e=d.firstChild; e; e=e.nextSibling) {
this.appendChild(e);
}@sorvell In the case that the container does not require distribution, composition is fast-pathed and e is inserted into the composed DOM, rendering e.nextSibling null. Should probably capture an array copy of children and iterate that as @SmokyBob suggested.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
JSbin + workaround
When trying to set a inner HTML only the first element is added to the node.
Polymer.dom(node).innerHTML = "<div>added</div><div>missing</div>"A work around is to wrap the new html inside a div (see JS bin)
I think the culprit is this that uses
e.nextSibling.I think the for should loop over
d.childrenor I miss something (ex. performance reason, etc...)?