Repository navigation
Process out-of-band swaps inside partials - #4203
Open
xunguangzlj-cloud wants to merge 1 commit into
Open
xunguangzlj-cloud wants to merge 1 commit into
xunguangzlj-cloud wants to merge 1 commit into
Conversation
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
An element marked
hx-swap-oobinside an<hx-partial>was inserted with the partial's content. The original out-of-band target stayed unchanged, leaving two elements with the same ID.Process the explicit out-of-band elements before cloning the partial's content. The partial and the out-of-band element then update their own targets. The partial reference documents the combination.
Corresponding issue: #4202. This covers the reported out-of-band element inside a partial.
Testing
ec5a055in Chrome using a real loopback HTTP response. The original status stayed unchanged and the ID appeared twice. With the fix, both targets update and the ID appears once.hx-swap-oobtests pass.hx-livedebounce test.node --checkandgit diff --checkpassed. Thefour-devbranch does not define annpm run formatscript.AI assistance: Codex helped implement the fix and run the browser tests.
Checklist
four-devfor the htmx 4 bugfix.npm testlauncher was not used. The full suite passed with the installed Chrome override described above.