Skip to content
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.

Adjacent slots render content incorrectly #329

Closed
sorvell opened this issue Apr 12, 2019 · 1 comment
Closed

Adjacent slots render content incorrectly #329

sorvell opened this issue Apr 12, 2019 · 1 comment
Assignees

Comments

@sorvell
Copy link
Contributor

sorvell commented Apr 12, 2019

See https://jsbin.com/japupemidu/edit?html,output.

@sorvell sorvell self-assigned this Apr 12, 2019
@sorvell
Copy link
Contributor Author

sorvell commented Apr 12, 2019

This issue can occur when the parser generates children after a shadowRoot has been created. This typically only happens when a shadowRoot is created by a custom element that's defined before the parser hits the element in question. It can easily be addressed by moving the element definition after the HTML containing the element as shown here: https://jsbin.com/peyudoz/edit?html,output.

It's not clear how to address this issue without a negative impact on performance. We could defer all shadowRoot render until after DOMContentLoaded. This would avoid the problem but it is pretty drastic and postpones a lot of work that could otherwise happen. I don't think there's a good platform signal for "the parser has finished creating children for this element."

In the absence of that, I'm inclined to suggest working around this by defining elements after HTML that contains any of the defined elements as this is a good general practice anyway.

@sorvell sorvell closed this as completed Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant