support extended css selectors in hx-partial - #3924
Merged
Merged
Conversation
Collaborator
|
I think it'd be more sane if Can we combine this with #3926 and close one of the PRs? |
Contributor
|
Thank you Latent! |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Found we can easily support extended selectors in hx-partial targeting. This allows you to target elements relative to the triggering source element using all the htmx enhanced selectors like closest, previous, next etc.
Also fixed a bug in the same code where if you only have hx-partial's and they don't find valid targets it would not do the expected behaviour of blocking the empty main swap. we just need to make sure it always emits a partial task so the auto empty detection code works.
Corresponding issue:
Testing
added a basic test
Checklist
masterfor website changes,devforsource changes)
approved via an issue
npm run test) and verified that it succeeded