codex-team / editor.js

A block-style editor with clean JSON output
https://editorjs.io
Apache License 2.0
28.52k stars 2.08k forks source link

Click to tune does not work inside shadow DOM #2274

Open damodharanj opened 1 year ago

damodharanj commented 1 year ago

Click to tune does not work inside shadow DOM

Steps to reproduce:

  1. Go to Demo
  2. Try writing and use "Click to tune"
  3. No operation happens

Expected behavior: Default actions of Editor.js

Screenshots:

Screenshot 2023-02-15 at 4 00 28 PM

Device, Browser, OS: Mac, Chrome

Editor.js version: @latest

Plugins you use with their versions:

EisenbergEffect commented 1 year ago

It would be great if the Editor.js team could do some work to ensure that everything functions properly inside of a shadow root. There's another issue, #2026 that relates to this as well.

I worked with one of the rich text editor teams at Microsoft to get their editor working in a shadow dom. Here are a couple of notes:

Microsoft was able to get the RoosterJS editor up and running in shadow dom last year without much effort, so it should be possible to get Editor.js working as well. This would be a great selling point for the library. It's the only thing holding me back from using it and recommending it broadly right now.

Looking forward to these fixes. Can't wait to start using this!

unilynx commented 1 year ago

This would also be a first step towards safely loading parts of a website's CSS into the editor to get closer to a WYSIWYG (without having to style the editor explicitly) - eg to get H1, H2 and Paragraph styling (and especially their vertical margin rules) to match the website