Skip to content

Commit 2c4906b

Browse files
committed
fix: mount wysiwyg editor once its module finishes loading
1 parent 0e76e11 commit 2c4906b

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

frontend/wysiwyg-editor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,4 +1051,8 @@ const autoInit = (elId) => {
10511051

10521052
if (typeof document !== "undefined") {
10531053
window.autoInit = autoInit
1054+
// Handshake for pages whose Alpine components initialize before this module
1055+
// finishes loading (deferred script, cold cache): they wait for this event
1056+
// instead of calling window.autoInit directly.
1057+
window.dispatchEvent(new CustomEvent("wysiwyg-editor-ready"))
10541058
}

0 commit comments

Comments
 (0)