7 ms·
The "end of contentEditable" spin in this is weird. CKEditor 5 uses contentEditable. And that's a good decision—getting bidirectional text, IME, touch selection
by marijn 9y ago
The "end of contentEditable" spin in this is weird. CKEditor 5 uses contentEditable. And that's a good decision—getting bidirectional text, IME, touch selection, spell-check, and screen reader support right without contentEditable, while possible, would require you to reimplement a _lot_ of browser functionality, which would necessarily lead to a blowup of complexity and download size.
So sure, the new CKEditor does more or less what Quill, Slate, ProseMirror, and most other modern WYSIWYG components do—it separates its data model from the editable DOM. That's good, but not new.
- amelius 9y agoI'm wondering, how does Google Docs do it? And how do they achieve having a reasonably compact size?
- marijn 9y agoThey appear to have reimplemented most of these things, doing their own layout entirely etc. I wouldn't call google docs compact, but indeed, it's also not overly bloated, and it handles corner cases well. It'd be interesting to know more about its architecture.
- igravious 9y agoI can't find where in the codebase they employ contentEditable. Are you sure they still use it? Here is a GitHub search: https://github.com/ckeditor/ckeditor5/search?utf8=%E2%9C%93&q=contentEditable&type= https://github.com/ckeditor/ckeditor5/search?utf8=%E2%9C%93&... 3 Markdown documents, one JSON doc.
- marijn 9y agoFocus a demo editor [1] and inspect `document.activeElement` in the console. You'll get a parent div of the content whose `contentEditable` attribute is true. [1]: https://docs.ckeditor.com/ckeditor5/latest/examples/builds/classic-editor.html https://docs.ckeditor.com/ckeditor5/latest/examples/builds/c...