Skip to content

Unify method/action resolution and improve hx-action doco#3883

Merged
1cg merged 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:action-method
Jul 9, 2026
Merged

Unify method/action resolution and improve hx-action doco#3883
1cg merged 2 commits into
bigskysoftware:four-devfrom
MichaelWest22:action-method

Conversation

@MichaelWest22

Copy link
Copy Markdown
Collaborator

Description

Found we can improve hx-action to fall back to formmethod and method native attributes just like hx-boost already does. This allows some better progressive enhancement options when moving to use the more natural action based attribute. You can place a hx-action on a form and have it use native method attributes.

By combining hx-action and hx-boost action and method calculation logic it also simplifies the code required as well.

Updated doco to highlight the progressive enhancment options and method fallback.

Corresponding issue:

Testing

Added new hx-action tests to cover the new behavior. should be no problem breaking changes for valid existing use cases as we are just adding a method fallback that was not usable before and it would have been confusing before if native method did not override the method used.

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 the htmx 4 Issues specific to htmx version 4 label Jul 6, 2026
@1cg

1cg commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Great change, thank you!

@1cg 1cg merged commit 236babc into bigskysoftware:four-dev Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

htmx 4 Issues specific to htmx version 4

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants