ckeditor / ckeditor5-react

Official CKEditor 5 React component.
https://ckeditor.com/ckeditor-5
Other
425 stars 99 forks source link

Issue with demo npm-multiroot-react when using minimap plugin #548

Open NikoEscobar opened 1 month ago

NikoEscobar commented 1 month ago

Description:
While testing the minimap plugin in the npm-multiroot-react demo, I added the plugin to the editor config and set the element ID. However, I encountered an error, and all editors failed to load.

Steps to Reproduce:

  1. Add the minimap plugin to editor config.
  2. Set the container on the minimap config.
  3. Run the demo.

Question:
Does the multi-root editor support the minimap plugin? Is there a missing configuration, or does the plugin need an update for multi-root support?

Attachments:

Witoso commented 1 month ago

does the plugin need an update for multi-root support?

Most likely this is the case, and the Minimap didn't get multiroot support. Do you remember @scofalik?

NikoEscobar commented 1 month ago

@Witoso Minimap currently doesn't support the multi-root editor.

https://github.com/ckeditor/ckeditor5/blob/master/packages/ckeditor5-minimap/src/minimap.ts#L88

I've implemented a fix, but I'm uncertain about its overall impact because I'm unable to run the automated tests in my environment—Karma is throwing errors on the CKEditor5 test script, and I can't look into it at the moment.

To provide a better solution, I need guidance on detecting multi-root usage and dynamically changing the rootName based on the editor's focus.

Image