-
-
Notifications
You must be signed in to change notification settings - Fork 650
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
Content inside of declarative shadow dom is not rendered #2802
Comments
Additional note: The above styling code works when not inside of declarative shadow dom, so it does seem to be specific to the tag.
|
I don't think declarative shadow DOM works in client-side rendering, does it? i.e., if I do this let tpl = document.createElement("template");
tpl.setAttribute("shadowrootmode", "open"); then let working = document.createElement("p");
working.setHTMLUnsafe(`<my-component>
<template shadowrootmode="open">
<style>* { color: blue; }</style>
<p>Hello, world!</p>
</template>
</my-component>`); This framework works primarily by building up a tree of DOM nodes using ordinary DOM operations (as in the first example), not by parsing from HTML (as in the second example). I would not expect this example to work in this or any other front-end framework that doesn't build in specific support for declarative shadow DOM by special-casing (Note also that the "working" version has limited browser support.)
This section is intended for you to show which version of Leptos you are using, i.e., what your Leptos dependency is. |
Sorry for the delay, we had a holiday in Japan yesterday. For the context of my feature request description, it's black boxing the implementation from the point of view of a user. Please don't take it as a request for a specific implementation. From the SSR Side: From the CSR Side: I can possibly assist in implementing this if there is interest. Obviously it would add some complexity which needs to be weighed for its value. Thank you for the information on the dependencies section, I'll add the toml file. |
Sounds good. This is a once-in-two-years request, so I'll leave it open as a feature request and feel free to make a PR. |
Thank you! It may take me a month or so as I have to get used to the code base and I am ramping up on rust coming from a typescript/C background. |
Describe the bug
I am attempting to use a shadow dom tag in leptos and nothing is rendered for the content. This same html works in a normal html file.
Leptos Dependencies
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Shadow dom in declarative shadow dom should render. It is valid html.
For reference, for the given html,
It should render this:
The text was updated successfully, but these errors were encountered: