codex-team / editor.js

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

Access Caret module #2020

Open miquik opened 2 years ago

miquik commented 2 years ago

Hi everybody, Is it possibile to access "Caret" module (and in general any modules)? I'm writing a block tool and I need to know caret position. I have access to CaretAPI which expose some methods for setting position. Should I use native Selection API?

Thanks

neSpecc commented 2 years ago

I think it would be nice to move the Caret methods to some utility library, so we can use it both in core and plugins.

For now, some plugins have to duplicate some Caret code.

neSpecc commented 2 years ago

Anyway, at the moment, you can use the native Selection API