diff --git a/modules/ckeditor5/js/ckeditor5.js b/modules/ckeditor5/js/ckeditor5.js
index f2c69f41..682d0001 100644
--- a/modules/ckeditor5/js/ckeditor5.js
+++ b/modules/ckeditor5/js/ckeditor5.js
@@ -391,7 +391,10 @@
             editor.ui.view.editable.element.append(element);
 
             const styles = window.getComputedStyle(element);
-            const height = element.clientHeight;
+            //const height = element.clientHeight;
+            //If the element has a height, use that, otherwise use 24px. This is for
+            //ckeditors that are not in the viewport, which calculate height to only 65px once displayed.
+            const height = element.clientHeight > 0 ? element.clientHeight : 24;
             const marginTop = parseInt(styles.marginTop, 10);
             const marginBottom = parseInt(styles.marginBottom, 10);
             const mostMargin =
