question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with shadow DOM

See original GitHub issue

I’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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Ntukcommented, Jul 1, 2020

A ‘bit’ late to the party but did you guys figure this out? 😃

1reaction
miguelyoobic95commented, Jan 24, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found