gorgeous-ghost-95789
03/13/2022, 2:50 AMgorgeous-ghost-95789
03/13/2022, 2:51 AMgorgeous-ghost-95789
03/13/2022, 2:52 AMcalm-ice-23682
03/13/2022, 1:34 PMmost-jelly-15242
03/13/2022, 1:49 PMhtmx:afterProcessNode event. If the processed node has an hx-target attribute and the target selector, in this case using an id, doesn't exist, then I create it and append it to the body.gorgeous-airport-54386
03/13/2022, 2:03 PMgorgeous-ghost-95789
03/13/2022, 2:31 PMgorgeous-airport-54386
03/13/2022, 3:53 PMfaint-egg-43233
03/13/2022, 4:32 PMmysterious-toddler-20573
03/13/2022, 4:59 PMancient-shoe-86801
03/13/2022, 5:04 PMancient-shoe-86801
03/13/2022, 5:06 PMancient-shoe-86801
03/13/2022, 5:08 PMadamant-exabyte-92636
03/13/2022, 5:32 PMcolossal-caravan-9184
03/13/2022, 5:43 PMancient-shoe-86801
03/14/2022, 2:17 AM<div triggering an htmx-request id="bar"></div>
<div id=foo></div>
And my response is:
<div>X</div>
<article hx-swap-oob="innerHTML:#foo"><p>Foo!</p><article>
I would expect the end result to be:
<div>X</div>
<div id=foo><article><p>Foo!</p><article></div>
But instead I end with:
<div>X</div>
<div id=foo><p>Foo!</p><div>
If instead I use outerHTML:#foo, I end with:
<div>X</div>
<article><p>Foo!</p><article>
That I understand, but the innerHTML cases is confusing me, as I would expect the element containing the hx-swap-oob attribute to also be put inside the target element.ancient-shoe-86801
03/14/2022, 2:19 AMafterbegin to accomplish that, and my understanding of innerHTML is just wrong?mysterious-toddler-20573
03/14/2022, 3:21 AMancient-shoe-86801
03/14/2022, 3:38 AMbrainy-ice-92385
03/14/2022, 4:21 AMid of the container also has non-standard meaning. Why not make that be an hx- attribute?
But it seems to be an inconsistent choice, when so much of HTMX passes "the law of least suprise" with flying colors
Also I noticed that if the swap-oob element came first in the fragment, the other data was not swapped at all. Didn't see this behavior documented.ancient-shoe-86801
03/14/2022, 4:22 AMancient-shoe-86801
03/14/2022, 4:24 AMbrainy-ice-92385
03/14/2022, 4:25 AMancient-shoe-86801
03/14/2022, 4:26 AMgorgeous-airport-54386
03/14/2022, 6:56 AMmysterious-toddler-20573
03/14/2022, 1:09 PMrefined-waiter-90422
03/14/2022, 2:10 PMrefined-waiter-90422
03/14/2022, 2:11 PMmysterious-toddler-20573
03/14/2022, 2:11 PMmysterious-toddler-20573
03/14/2022, 2:11 PM