move to allowEmptySwapAfterOOB config instead of defaultSwapEmpty - #3942
Open
MichaelWest22 wants to merge 2 commits into
Open
move to allowEmptySwapAfterOOB config instead of defaultSwapEmpty#3942MichaelWest22 wants to merge 2 commits into
MichaelWest22 wants to merge 2 commits 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
Change the empty swap behavior so that oob work the same as hx-partial do now. when only oob content is in the response it will now not swap the main target with an empty response like it did before. This could mean that a response that is trying to blank out the requesting form with an empty response and place the form's completed action into another location with hx-swap-oob it will now not remove the form as it did before. Ther is a new config item allowEmptySwapAfterOOB which can be configured to return oob behavior back to the old way where empty contents will swap after removing oob's. hx-partial is set to always prevent empty swap if present and you have to use swapEmpty swap modifier to alter this.
Removed the defaultSwapEmpty global config because this config can cause unexpected behavior like blocking deliberately empty responses from happening or breaking expected behavior with hx-partial only responses. Its better to be more explicit and control the empty swap behavior with swap modifiers per request instead.
Corresponding issue:
Testing
Please explain how you tested this change manually, and, if applicable, what new tests you added. If
you're making a change to just the website, you can omit this section.
Checklist
masterfor website changes,devforsource changes)
approved via an issue
npm run test) and verified that it succeeded