Open SuperOleg39 opened 10 months ago
Another solution - is custom events propagation, e.g. https://codepen.io/surf4sites/pen/rNogYzN
But event will be not "trusted", can be problems for example with save content to buffer.
Too many problems with this solution
Good source of information how this can work (also with Notion source code research)
And another useful info about contenteditable
More about root contenteditable issues and possible solutions - https://github.com/Dashibase/lotion/issues/13#issuecomment-1201343949
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/24930829So, there is a few ways to solve this problem:
contenteditable
elements tree outside of React - need to rewrite existings blocksNeed to investigate and select optimal solution.