]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/markdown-editor.js
Updated minimum php version from 7.3 to 7.4
[bookstack] / resources / js / components / markdown-editor.js
index def3db5af864f30cd6f321d2f47c80240b9b1dd1..a14047d2f430155083b614773abe1a05f246bb38 100644 (file)
@@ -112,6 +112,11 @@ class MarkdownEditor {
         if (scrollText) {
             this.scrollToText(scrollText);
         }
+
+        // Refresh CodeMirror on container resize
+        const resizeDebounced = debounce(() => code.updateLayout(this.cm), 100, false);
+        const observer = new ResizeObserver(resizeDebounced);
+        observer.observe(this.elem);
     }
 
     // Update the input content and render the display.