diff --git a/core/modules/ckeditor5/js/ckeditor5.js b/core/modules/ckeditor5/js/ckeditor5.js index 583c707fd9..a81904064f 100644 --- a/core/modules/ckeditor5/js/ckeditor5.js +++ b/core/modules/ckeditor5/js/ckeditor5.js @@ -371,8 +371,19 @@ ClassicEditor.create(element, editorConfig) .then((editor) => { // Save a reference to the initialized instance. - Drupal.CKEditor5Instances.set(id, editor); + const toPx = function () { + const element = jQuery( + '
', + ).appendTo('body'); + const height = element.height(); + element.remove(); + return height; + }; + Drupal.CKEditor5Instances.set(id, editor); + const rows = editor.sourceElement.getAttribute('rows'); + const heightNew = rows * toPx(); + editor.ui.view.editable.element.style.minHeight = `${heightNew} px`; // CKEditor 4 had a feature to remove the required attribute // see: https://www.drupal.org/project/drupal/issues/1954968 if (element.hasAttribute('required')) {