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

Finalize how to render to shadowDOM #38

Open
phillipskevin opened this issue Jun 25, 2019 · 2 comments
Open

Finalize how to render to shadowDOM #38

phillipskevin opened this issue Jun 25, 2019 · 2 comments
Labels
question Further information is requested

Comments

@phillipskevin
Copy link
Contributor

You currently can render into shadowDOM by setting the viewRoot property:

https://github.com/canjs/can-stache-define-element/blob/75be0f9c937459f6eba13bcf21a09ec7999c26e4/src/mixin-stache-view-test.js#L44

This isn't currently documented because we might want to change how this works. It might be easier to just automatically render into shadowDOM if attachShadow was called and not have a special viewRoot property. Although maybe there will be use-cases for rendering somewhere else, so viewRoot might be useful.

@phillipskevin phillipskevin added the question Further information is requested label Jun 25, 2019
@matthewp
Copy link
Contributor

I think viewRoot is a bit more flexible than checking for a .shadowRoot property. It's explicit and will work with closed shadow roots as well. If a shadow exists then there's probably no point of rendering a template into the light DOM. At least I've never heard of anyone doing that. Keeping viewRoot gives you flexibility here. You could render a template into the shadow (manually) and have the framework render it into the element light DOM. Weird but possible.

@justinbmeyer
Copy link
Contributor

the portal helper is semi-similar ... not sure if this means anything from an API perspective

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

No branches or pull requests

3 participants