Problem/Motivation
In Drupal 10, CKEditor 4 will be replaced with CKEditor 5. It can be tested following the steps on https://www.drupal.org/docs/core-modules-and-themes/core-modules/ckedito...
The CKEditorheight configuration has no effect on the height of text areas and their autogrow.
Steps to reproduce
- Enable CKEditorHeight module
- Enable CKEditor 5 module.
- Configure CKEditorHeight by ticking "Disabled autgrow" and save on /admin/config/ckeditorheight/settings
- Configure the Basic HTML by selecting "CKEditor 5" instead of "CKEditor".
- Create a Page on /node/add/page: The Body field is only one row, and it auto-grows.
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ckeditor5.js_.txt | 901 bytes | mark_fullmer |
Issue fork ckeditorheight-3274041
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
geek-merlinThx ifrik for pointing this out early. MRs appreciated!
Comment #4
mark_fullmerComment #5
mark_fullmerThe issue in the CKEditor 5 queue regarding manipulating height is https://github.com/ckeditor/ckeditor5/issues/636 .
It doesn't appear that they're providing a API-based solution as of right now, like a configuration option. A workaround is referenced in https://github.com/ckeditor/ckeditor5/issues/636#issuecomment-405952805 , specifically https://stackoverflow.com/a/46559355 , specifying that the CKEditor editable area can be targeted via
.ck-editor__editable_inlineIf we port the ability to disable the auto_grow plugin to this module, the attached JS would effectively solve this issue. (With auto_grow enabled, the min-height will keep getting reset).
For those who are looking for a low-tech solution for this and don't need the dynamic line-height adjustments provided by the ckeditorheight module, it should be sufficient to add a compendium of CSS that reacts to the the various row heights populated by Drupal textareas. I've tested the below approach and it works well:
Comment #6
geek-merlinThx for sharing your research! Disabling the autogrow plugin should not be too hard, and if someone (tm) puts the peaces together, we are ready to release a 2.x version for ckeditor5. THat said, i won't do it soon-ish, but someone picks this up, a MR is appreciated!
Comment #7
geek-merlinComment #8
geek-merlinSee #3241295-25: CKEditor 5 isn't respecting field widgets row settings.
Comment #9
geek-merlinComment #10
geek-merlinWe're core.