The transition behaviour described here has an unintended side effect, which breaks our application. The same use case worked with Intercooler.js, but for other reasons we must migrate to HTMX. In particular HTMX removes classes on replaced DOM elements that have been added to the swapped DOM element during the settle period.
Assume you have a target as follows:
<div id="target">
<div id="replaced" class="irrelevant"></div>
</div>
We are going to replace #target's innerHTML via hx-post/hx-swap with the following HTML returned by the server:
<div id="replaced" class="first"></div>
Now assume after the #replaced element has been swapped into the DOM but before the DOM is settled (before htmx-settling is removed), #replaced has gained another class second. Then, after the settle delay, HTMX sets the class attribute to the value originally obtained from the server (here: "first") and therefore effectively removes the second class from #replaced.
If would therefore be great if there was a way to disable the settling mechanism during specific swaps.
The transition behaviour described here has an unintended side effect, which breaks our application. The same use case worked with Intercooler.js, but for other reasons we must migrate to HTMX. In particular HTMX removes classes on replaced DOM elements that have been added to the swapped DOM element during the settle period.
Assume you have a target as follows:
We are going to replace
#target'sinnerHTMLviahx-post/hx-swapwith the following HTML returned by the server:Now assume after the
#replacedelement has been swapped into the DOM but before the DOM is settled (beforehtmx-settlingis removed),#replacedhas gained another classsecond. Then, after the settle delay, HTMX sets theclassattribute to the value originally obtained from the server (here:"first") and therefore effectively removes thesecondclass from#replaced.If would therefore be great if there was a way to disable the settling mechanism during specific swaps.