This repo contains a repro of an issue with CKEditor5 configuration when using useMultiRootEditor
and a custom widget.
When using useMultiRootEditor
and a custom widget, the editor crashes with the following error:
mapping-model-position-view-parent-not-found {"modelPosition":{"root":"numbered_prefatory_text_nkqRVYKF-prefatory-text-0","path":[0,0,0],"stickiness":"toNext"}} Read more: https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html#error-mapping-model-position-view-parent-not-found
Error documentation can be found here
This error however is not reproducible when using <CKEditor>
component from the @ckeditor/ckeditor5-react
package, or when using manual initialization of the editor.
This repo contains 3 examples:
- ClassicEditorExample - using
<CKEditor>
component from the@ckeditor/ckeditor5-react
package - this example works as expected - MultiRootEditorViaHookExample - using
useMultiRootEditor
hook from the@ckeditor/ckeditor5-react
package - this example crashes with the error - MultiRootEditorViaManualInitializationExample - using manual initialization of the editor - this example works as expected
This project was bootstrapped with Vite, using the react-ts
template.
- CKEdtitor integration leverages this guide Integrating from source using Vite
- The custom widget is a simplified version of the inline widget, referenced here Implementing an inline widget
- Examples are following these guides:
- Classic Editor example integration is using React Integration guide
- MultiRootEditor via hook example integration is
useMultiRootEditor
ckeditor/ckeditor5-react - MultiRootEditor via manual initialization example integration is using manual initializing that follows vanilla JS example
Install dependencies:
yarn
Run the application in DEV mode
yarn dev
Assuming default configration & port is available the app will be served at http://localhost:5173/
You should be able to see something like this