Skip to content

Add hx-partial tag handling to v2 - #4050

Open
MichaelWest22 wants to merge 1 commit into
bigskysoftware:devfrom
MichaelWest22:hx-partial-v2
Open

Add hx-partial tag handling to v2#4050
MichaelWest22 wants to merge 1 commit into
bigskysoftware:devfrom
MichaelWest22:hx-partial-v2

Conversation

@MichaelWest22

@MichaelWest22 MichaelWest22 commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Description

This adds a back port of the hx-partial tag into htmx 2. It is a clean simple addition that just adds the parsing and required and a new findAndSwapPartials funciton that runs after processing OOB's. The only other core change is to prevent the main swap if the response is only white space after the new hx-partials are detected as the only swap contents. This leaves OOB behaviour unchanged so there should be no breaking changes. Also adds some new events and support to extend and use hx-xxxx tags via a htmx:processTemplate event.

Corresponding issue:

Testing

Added new tests for hx-partial

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

@MichaelWest22 MichaelWest22 added enhancement New feature or request 2.0 labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0 enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant