bigskysoftware / bigskysoftware/htmx

HX-Reselect does not support "unset" (like hx-select does)

Open
#3,152 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
49.4k
Forks
1.7k
Avg merge
3d 22h
Merged PRs (30d)
30

Description

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:

```html

Click me

```

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.