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

Fixing #3165 #3166

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

Fixing #3165 #3166

wants to merge 1 commit into from

Conversation

mrinc
Copy link

@mrinc mrinc commented Feb 2, 2025

Description

Fixes case where htmx is loaded async and DOMContentLoaded is never fired.
By using window.onload as well, we cover the case where it is not fired.
No change to current behavior but fixes the case of dynamically loading htmx.

Corresponding issue: #3165

Testing

Lets discuss how we should test this one and then can just update the test suite accordingly.
It's specific case where the htmx lib is loaded async.
htmx itself operates the same, the big issue occurs when you try go back in the browser (I could be missing something...).
However this does bring up other notes where the ready function isn't run - so we should be testing for that currently.
So it's not just, lets add a single test case, it's we should add a single test case for the ready function in the 2 cases, but we should also be running all the tests again, in an async loaded state to make sure htmx behaves the same in both load-state cases.

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

Fixes case where htmx is loaded async and DOMContentLoaded is never fired.
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