Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/hx reselect support unset #3153

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

oliverhaas
Copy link

@oliverhaas oliverhaas commented Jan 28, 2025

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
Copy link
Collaborator

@Telroshan Telroshan left a comment

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
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)
2 participants