HX-Reselect does not support "unset" (like hx-select does)
Pretty much the title.
HX-Reselect does not support unset like hx-select does.
I guess this is a pretty rare case, but I wanted to basically do the following:
<button hx-select="#some_div" hx-target="#some_div">
Click me
</button>
Then on the server side I want to switch to a body swap, and since hx-select is set I need to unset it.
HX-Retarget = "body"
HX-Reselect = "unset"
Such a body swap might be the only case where unset really matters, since otherwise one is probably able to just work with css selectors. In this case I don't think there is a way. Yes, I've tried :scope, :host, *, > *, and all other suggestions for the selector I could find. maybe I'm missing something...
But in any case: I think it would be nice if htmx would just support the HX-Reselect override with unset like one would expect.
For current version, does HX-Reselect = "*" work as same as unset?
I think the problem with work-arounds such as HX-Reselect = ":scope > *" is that they will only match elements and not immediate text nodes. That limitation will be fine in some cases and not others.