Hi, I’m using HTMX with morph in my project. I created a custom Lit component using Light DOM by overriding:
createRenderRoot() {
return this
}
Problem:
When using:
everything works fine, and the component keeps its internal DOM structure.
However, when using:
hx-swap="morph:outerHTML"
the internal DOM disappears. Only the custom element tag remains:
Before swap:
<r-api-combobox id="someId" ...>
<div
<wa-input ...>
...
</wa-input>
<div class="error-message" ...></div>
<input type="hidden" name="bankId" value="2">
</div>
</r-api-combobox>
After swap:
<r-api-combobox id="someId" ...></r-api-combobox>
It seems that morph does not preserve the Light DOM children of custom elements, unlike a normal outerHTML swap.
Question:
Is there any configuration or solution to prevent Light DOM children from being removed when using hx-swap="morph:outerHTML" with Lit custom elements?
Hi, I’m using HTMX with morph in my project. I created a custom Lit component using Light DOM by overriding:
Problem:
When using:
everything works fine, and the component keeps its internal DOM structure.
However, when using:
the internal DOM disappears. Only the custom element tag remains:
Before swap:
After swap:
It seems that morph does not preserve the Light DOM children of custom elements, unlike a normal outerHTML swap.
Question:
Is there any configuration or solution to prevent Light DOM children from being removed when using hx-swap="morph:outerHTML" with Lit custom elements?