You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on upgrading BeFunky to the latest version of Lit and Haunted.
We currently don't use shadow DOM for components, and I noticed that when useShadowDOM: false is set, Haunted doesn't clear the initial content in the custom element before rendering. Initial content is really helpful for progressive enhancement, avoiding layout shift when the component JS loads and renders, e.g.
Slightly related to the question, is there a pragmatic way to use slotted content and/or retrieve the initial content before the first render? Currently playing with this on [email protected]:
I'm working on upgrading BeFunky to the latest version of Lit and Haunted.
We currently don't use shadow DOM for components, and I noticed that when
useShadowDOM: false
is set, Haunted doesn't clear the initial content in the custom element before rendering. Initial content is really helpful for progressive enhancement, avoiding layout shift when the component JS loads and renders, e.g.This was fine in Lit
1.*
, but in Lit2.*
, the render() function doesn't clear the container's contents.From the Lit upgrade guide: https://lit.dev/docs/releases/upgrade/#lit-html
I'm guessing we'll need to set
component.innerHTML = ''
before the first render manually whenuseShadowDOM: false
is set.Bug replicated in Codepen: https://codepen.io/pranksinatra/pen/XWqrpBj
The text was updated successfully, but these errors were encountered: