Issue with shadow DOM
See original GitHub issueI’m trying to build a webcomponent with tippyjs in stenciljs.
const target = this.host.shadowRoot.querySelector("#target") as HTMLDivElement;
const template = this.host.shadowRoot.querySelector("#template") as HTMLDivElement;
console.log(target);
console.log(template);
tippy(target, {
html: template,
onShow() {
console.log("about to show");
},
onHide() {
console.log("about to close");
}
});
This is the component will load function (basically on init), and this is the actual html.
<div id="template" style={{ display: "none" }}>
<h3>
Cool <span>HTML</span> inside here!
</h3>
</div>
Any help would be greatly appreciated.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
What are the drawbacks of using Shadow DOM?
Shadow DOM features can be seen as drawback as much as benefits: Style isolation is a benefit if you want it but a...
Read more >Using shadow DOM - Web Components | MDN
Shadow DOM allows hidden DOM trees to be attached to elements in the regular DOM tree — this shadow DOM tree starts with...
Read more >Shadow DOM and accessibility: the trouble with ARIA
Shadow DOM is a kind of retcon for the web. As I've written in the past, shadow DOM upends a lot of developer...
Read more >Everything you need to know about Shadow DOM · GitHub
A host element that has shadow DOM, only renders stuff that goes inside it's shadow DOM. In order to get light DOM elements...
Read more >5. Working with the Shadow DOM - Modern JavaScript [Book]
The shadow DOM is essentially a way to define a new DOM tree whose root container, or host, is visible in the document,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

A ‘bit’ late to the party but did you guys figure this out? 😃
Hey @atomiks, I commented on one of the issues before but I am not sure you saw the comment, I’m happy to help you with this since we have exactly the same use case and this will make your library compatible with things like Ionic4, StencilJS which have now started to heavily use shadow DOM. I’m happy to schedule a call or something if needed to discuss