Overlay should load not for DOMContentLoaded event only if document has already complete loading.

This commit is contained in:
Davide Tantillo 2025-03-24 17:36:02 +01:00
parent f3612e73cf
commit ec314953bb

View File

@ -833,7 +833,7 @@ export class SpineWebComponentWidget extends HTMLElement implements Disposable,
this.initAfterConnect(); this.initAfterConnect();
} else { } else {
window.addEventListener("DOMContentLoaded", this.DOMContentLoadedHandler); window.addEventListener("DOMContentLoaded", this.DOMContentLoadedHandler);
if (document.readyState !== "loading") { if (document.readyState === "complete") {
this.DOMContentLoadedHandler(); this.DOMContentLoadedHandler();
} }
} }