close
Skip to content

Feat/hx reselect support unset - #3153

Merged
1cg merged 1 commit into
bigskysoftware:devfrom
oliverhaas:feat/hx-reselect-support-unset
Jun 2, 2025
Merged

Feat/hx reselect support unset#3153
1cg merged 1 commit into
bigskysoftware:devfrom
oliverhaas:feat/hx-reselect-support-unset

Conversation

@oliverhaas

@oliverhaas oliverhaas commented Jan 28, 2025

Copy link
Copy Markdown
Contributor

Description

HX-Reselect currently does not support unset like the attribute hx-select does. I think an htmx user would expect that, and for me it is quite handy to have that feature.

I hope it is okay for me to open a PR to illustrate the linked issue, since it's somewhere in-between a feature and a bugfix I would say.

Corresponding issue: #3152

Testing

Basically already using this in one of my projects to have server-side rendering of redirects.

If the server would trigger a redirect, I just render the response of the redirected view and use HX-Reselect, HX-Retarget, HX-Reswap for swapping. Saves me one round trip and let's me use redirects more freely. And for full body swaps I need to use unset.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan linked an issue Jan 29, 2025 that may be closed by this pull request
@Telroshan Telroshan added the enhancement New feature or request label Jan 29, 2025

@Telroshan Telroshan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, makes sense to me to have the header replicate the attribute's potential values, including unset

@Telroshan Telroshan added the ready for review Issues that are ready to be considered for merging label Jan 29, 2025
@scrhartley

scrhartley commented May 14, 2025

Copy link
Copy Markdown
Contributor

I'd like to express my support of this since it will also allow htmx:beforeSwap to use unset as the value for selectOverride.

@oliverhaas

Copy link
Copy Markdown
Contributor Author

In case I'm missing something I have to do to get this merged, please tell me. I'd like to think I'm "experienced" by now, but a lot is still new to me :).

@scrhartley

Copy link
Copy Markdown
Contributor

In case I'm missing something I have to do to get this merged, please tell me. I'd like to think I'm "experienced" by now, but a lot is still new to me :).

Don't worry, just continue to be patient. The "ready for review" label means you're doing well.

@1cg
1cg merged commit 6d238f3 into bigskysoftware:dev Jun 2, 2025
@1cg

1cg commented Jun 2, 2025

Copy link
Copy Markdown
Contributor

@oliverhaas nothing on you, i'm just old, busy, tired and extremely lazy.

thanks for your contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request ready for review Issues that are ready to be considered for merging

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants