Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.9.0] Problem putting a dom-if template in a light DOM when the component's <content> itself is wrapped in a dom-if #1565

Closed
drarmstr opened this issue May 19, 2015 · 1 comment · Fixed by #1597
Assignees
Labels

Comments

@drarmstr
Copy link

If an inner-component wraps it's in a there is a problem if the user of that component also puts a in the light DOM. Suspicion is that someone is still trying to populate or deal with the even though it isn't stamped in the DOM?

Anyway, the end result is that things appear to more-or-less work except that when run with the Chrome debugger enabled there is an unhandled exception thrown:

polymer-mini.html:499 - nativeInsertBefore.call(container, node, ref_node);`  `DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

I wasn't able to exactly reproduce my situation. However, here is a test case to reproduce a similar issue: http://jsbin.com/nuxupejije/1/edit (Note, the expected output is only "inner_before inner_after", the problem is the unhandled exception. Though, this test case has the exception in dom-api.html:110 instead.

@kevinpschaaf
Copy link
Member

Root cause: insert/append into a shadyRoot with no insertion points bypasses distribute and goes to the native insert/append (in this case, the parent was properly "undistributed", hence the insertion should have no-op'ed).

Need to:

  • detect insert/append into shadyRoot with no insertion points and no-op
  • ensure element being inserted is removed if it was previously in the dom

After that, verify dynamic insertion works as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants