-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Open
Description
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:
hx-swap="outerHTML"
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?
gregjotau and devhassan941-png
Metadata
Metadata
Assignees
Labels
No labels