Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attach hx-on handlers before processing nodes #3131

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

rkilpadi
Copy link
Contributor

@rkilpadi rkilpadi commented Jan 14, 2025

Description

Currently, hx-on attributes are processed after triggers, causing issues where some triggers (i.e. load and sometimes revealed) are fired before hx-on handlers attach.
This change attaches hx-on attributes before triggers are processed. In doing so, the logic to conditionally de-init nodes had to be moved.
Discussion

Corresponding issue: #3106

Testing

  • Added tests to ensure hx-on attributes are triggered on revealed and load

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

@rkilpadi rkilpadi changed the title Attach hx-on handlers before processing node Attach hx-on handlers before processing nodes Jan 14, 2025
src/htmx.js Outdated Show resolved Hide resolved
@Telroshan Telroshan added the bug Something isn't working label Jan 15, 2025
@Telroshan Telroshan added the ready for review Issues that are ready to be considered for merging label Jan 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants