Skip to content

Fix colon-free hx-on handlers for compound htmx events - #4142

Open
sergioperezcheco wants to merge 1 commit into
bigskysoftware:devfrom
sergioperezcheco:fix/colon-free-compound-events
Open

sergioperezcheco wants to merge 1 commit into
bigskysoftware:devfrom
sergioperezcheco:fix/colon-free-compound-events

Conversation

@sergioperezcheco

Copy link
Copy Markdown

Description

Fixes #2614. Colon-free handlers such as hx-on--validation-validate currently miss htmx:validation:validate, so custom validity checks never run and invalid values can be submitted. Dispatch a distinct dash-separated alias for compound htmx event names, preserving canonical/camel-case aliases, shared detail, and cancellation ordering. Non-htmx custom event names are unchanged. This also covers hx-on--xhr-progress and documents both spellings.

Testing

The new regression file fails against unchanged production: 20 passing, 6 failing. With the fix, the complete upstream browser harness passes in headless Chromium: 877 passing, 3 skipped across 50 files. Lint, format, type checking, and the official distribution build pass. An independent DOM probe checks alias order, shared detail, cancellation, and custom-event compatibility; a real local HTTP form probe fails on the baseline and passes with both ordinary and minified official builds, blocking invalid submissions while allowing valid submissions.

The browser harness uses the existing Chromium executable through a launcher override. Literal npm run test, Firefox/WebKit, and other OS/Node matrices were not run; remote CI is pending. Prepared and tested autonomously with AI assistance; no human review has occurred.

Checklist

  • I have read the contribution guidelines
  • I have targeted dev for source changes
  • This is a bugfix for documented behavior
  • I ran the test suite locally using the literal npm run test command

Assisted-by: Hermes Agent
Signed-off-by: sergioperezcheco <checo520@outlook.com>
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