For now, every block is separate tag with contenteditable attribute.
Unfortunately, you can select text only in one focused contenteditable element, and native keyboard navigation not working between blocks.
One possible solution - add contenteditable attribute to editor root element. All of mentioned features will work natively.
There is a big disadvantage - some event handlers to nested contenteditable blocks will not works, example of this problem - https://stackoverflow.com/a/24930829
So, there is a few ways to solve this problem:
- Handle text selection and arrow navigation manually - possible rabbit hole of problems and workarounds
- Handle root
contenteditable elements tree outside of React - need to rewrite existings blocks
Need to investigate and select optimal solution.
For now, every block is separate tag with
contenteditableattribute.Unfortunately, you can select text only in one focused
contenteditableelement, and native keyboard navigation not working between blocks.One possible solution - add
contenteditableattribute to editor root element. All of mentioned features will work natively.There is a big disadvantage - some event handlers to nested
contenteditableblocks will not works, example of this problem - https://stackoverflow.com/a/24930829So, there is a few ways to solve this problem:
contenteditableelements tree outside of React - need to rewrite existings blocksNeed to investigate and select optimal solution.