Skip to content
Advertisement

Tag: lit-element

Lit-element – Importing a component inside another component and then accessing the DOM of the imported component

I’ve honestly racked my brain on this for a couple days. I’m decently new to lit-element and web components in general. Basically, I’m building a new component called <date-picker> and it uses the Flatpickr plugin. This Date Picker component imports another component called <textfield>. Inside of that component there is a wrapper(.date-picker) with an input field and an icon. I

Is it possible to pass a function from html into a lit-element?

I have seen examples of passing a function from a parent lit-element to a child one like here – https://medium.com/@westbrook/litelement-to-do-app-1e08a31707a4 But I want the users of my element, not to be forced to create a wrapper element to use my element. For example, my element is a dialog that computes some value. I was hoping I could do something like

Advertisement