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

[1.0.0] Light DOM being replaced by shady DOM on ready #1732

Closed
JamesLMilner opened this issue Jun 3, 2015 · 1 comment
Closed

[1.0.0] Light DOM being replaced by shady DOM on ready #1732

JamesLMilner opened this issue Jun 3, 2015 · 1 comment

Comments

@JamesLMilner
Copy link

I am currently porting an app from 0.5 to 1.0 and it appears that the nested custom components appear to be getting replaced by the shady DOM of the parent element.

Before the Shady DOM fully loads:

image

After the Shady DOM has loaded:

image

I am not currently doing an DOM manipulation that would cause this. The web component logic appears to run without an issue, only the Light DOM elements seem to have been removed/replaced. I can't seem to see any logical reason for this to be happening other than an issue.

Update: I put breakpoints on the elements 'when element is removed' this is the part of the polymer code that appears to be causing it:

 if (!this.shadyRoot._hasDistributed) {
 this.textContent = "";
 this.appendChild(this.shadyRoot);
 }

This is located on lines 1053 - 1056 of the Polymer library.

@JamesLMilner JamesLMilner changed the title Light DOM being replaced by shady DOM on ready [1.0.0] Light DOM being replaced by shady DOM on ready Jun 3, 2015
@JamesLMilner
Copy link
Author

I didn't realise you needed to use the content element to act as an insertation point for light DOM within your element (as per: https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#dom-distribution). This was not mentioned in the transition guide! I would recommend adding this to https://www.polymer-project.org/1.0/docs/migration.html for people used to using the stricter shadow DOM approach in 0.5.

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

No branches or pull requests

1 participant