Skip to content

move to allowEmptySwapAfterOOB config instead of defaultSwapEmpty - #3942

Open
MichaelWest22 wants to merge 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:oob-empty-swaps
Open

move to allowEmptySwapAfterOOB config instead of defaultSwapEmpty#3942
MichaelWest22 wants to merge 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:oob-empty-swaps

Conversation

@MichaelWest22

Copy link
Copy Markdown
Collaborator

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

  • 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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant