How to set the height of CKEditor 5 (Classic Editor)

后端 未结 17 1386
清歌不尽
清歌不尽 2020-12-01 08:41

In CKEditor 4 to change the editor height there was a configuration option: config.height.

How do I change the height of CKEditor 5? (the Classic Editor)

17条回答
  •  时光说笑
    2020-12-01 09:24

    From CKEditor 5 version 22 the proposed programmatic solutions are not working. Here it is how I get the work done:

    ClassicEditor.create( document.querySelector( '#editor' ) )
        .then( editor => {
            editor.ui.view.editable.element.style.height = '500px';
        } )
        .catch( error => {
            console.error( error );
        } );
    .ck-editor__editable {min-height: 500px;}

提交回复
热议问题