Lucia Ricciuti
Lucia Ricciuti

Reputation: 11

Accessing DOM by getElementById() in Vaadin 24 Lit component

I have a web component implemented with Lit and I need to invoke JS functions from a third party. These JS functions use document.getElementById() to modify the DOM of the web component. This instruction is not working because the inner elements of the web component are inside a shadow DOM.

I know I can access those elements from inside the web component using: this.shadowRoot.getElementById().

But I need to use a third party JS library. Is there a solution for this?

Upvotes: 1

Views: 162

Answers (0)

Related Questions