Search code examples
javascriptcssckeditorckeditor4.x

CKEditor height grow as use typing


I have a ckEditor, and I want to make the height of the ckEditor auto grow as I am typing.

enter image description here

<textarea name="description" id="description">
</textarea>
<script>
    CKEDITOR.replace( 'description' );
    CKEDITOR.config.contentsCss = [CKEDITOR.getUrl('contents.css'), CKEDITOR.getUrl('/js/ckeditor/skins/moono-dark/styles.css')];

</script>

Is there a way to do it via JS or CSS ?


Solution

  • Use Auto Grow addon.

    With this plugin, CKEditor will automatically expand and shrink vertically depending on the amount and size of content entered in its editing area.

    The following configuration options are available:

    maximum and minimum editor height after adjustment to content, extra space to be added between content and editor bottom bar, having auto grow happen on editor startup

    Note: This plugin is designed to work only with the classic editor.