Add interactive check to ready event handler (#1672)

If HTMX is imported in a module the readyState is "interactive"
so the extension processing happens too late. This would fix it.

Co-authored-by: Dave Syer <david_syer@hotmail.com>
This commit is contained in:
Alexander Petros 2023-08-04 19:10:26 -04:00 committed by GitHub
parent 295d9f83eb
commit 347ce7a19f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3605,7 +3605,7 @@ return (function () {
//====================================================================
function ready(fn) {
if (getDocument().readyState !== 'loading') {
if (getDocument().readyState === 'complete') {
fn();
} else {
getDocument().addEventListener('DOMContentLoaded', fn);