Creating a single-line field (disabling Enter) #99
Replies: 1 comment
-
I'm looking for similar functionality and I believe Restricted Editing is a way to go. It should be possible to add a DLL build of @ckeditor/ckeditor5-restricted-editing ( The only trick will be getting a bit of templated content, like, There is an Perhaps hooking into the fields with JavaScript and checking for existing content before asserting a default value. Or possibly writing a third-party CKEditor plugin with similar logic so a configuration option could be provided, like In any case, this is all conjecture until I sit down with it. EDIT: This issue is about the closest thing to this request, and it's all still up in the air. For the time being, I'm going to try a restricted toolbar of inline formatting only (bold, italic, underline, etc.) paired with striptags. Similar to mlncn's workaround for Drupal (in the above issue). Like: |
Beta Was this translation helpful? Give feedback.
-
We are in the process of converting existing fields from Redactor to CKEditor.
One of our fields disabled the Enter Key (using 'enterKey: false') which made the field act essentially as 'single line' field. We use this type of field quite often for text fields that span multiple lines, but not paragraphs.
It seems impossible to recreate the Redactor behaviour 100%, which would be the following:
The first option is solved using an updated HTML Purifier configuration. The second option does not seem possible out-of-the-box. We investigated a few things:
removePlugins
(API reference).Anyone created such a field using CKEditor 5 before? Any clue how to approach this?
Beta Was this translation helpful? Give feedback.
All reactions