3 ms·
It's always worth checking the lit built in directives list for the one you've still missed (or at least it is for me ;). I think in this case the ref() direct
by mst 2y ago
It's always worth checking the lit built in directives list for the one you've still missed (or at least it is for me ;).
I think in this case the ref() directive - i.e. https://lit.dev/docs/templates/directives/#ref https://lit.dev/docs/templates/directives/#ref - may be what you want. If it isn't exactly, reading how it's implemented would be my first step towards building something similar that is.
- AltruisticGapHN 2y agoThanks I created a custom directive, it's just ten lines of code and it works beautifully. Simply grabbed the `part.parentNode` property. I did the same for a `transition` directive that does something similar to using `appear` in Vue transition to have a nice fade in on first load.