Skip to content

Commit

Permalink
Add interactive check to ready event handler
Browse files Browse the repository at this point in the history
If HTMX is imported in a module the readyState is "interactive"
so the extension processing happens too late. This would fix it.
  • Loading branch information
dsyer committed Aug 2, 2023
1 parent 66387c0 commit 35812ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,7 @@ return (function () {
//====================================================================

function ready(fn) {
if (getDocument().readyState !== 'loading') {
if (getDocument().readyState !== 'loading' && getDocument().readyState !== 'interactive') {
fn();
} else {
getDocument().addEventListener('DOMContentLoaded', fn);
Expand Down

0 comments on commit 35812ba

Please sign in to comment.