Skip to content

danyloid/ckeditor5-react-plugin

Repository files navigation

ckeditor5-react-plugin

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:

  1. ClassicEditorExample - using <CKEditor> component from the @ckeditor/ckeditor5-react package - this example works as expected
  2. MultiRootEditorViaHookExample - using useMultiRootEditor hook from the @ckeditor/ckeditor5-react package - this example crashes with the error
  3. MultiRootEditorViaManualInitializationExample - using manual initialization of the editor - this example works as expected

Additional context

This project was bootstrapped with Vite, using the react-ts template.

CKEditor guides followed

Running the app locally

Prerequisites

  • Node.js version 18+. 20+., version requirement is driven by Vite

Running the app

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

image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published