I am building an extended editor based on draft-js to add a footnote feature. When writing text in the main editor, the user has the option to click "add footnote", which adds a footnotemark (a badge with the number of the note) at the current selection, and opens a secondary editor where to write the text of the note.
It all works well, except that if you add a note at the very end of a content-block, it is impossible to place the cursor after the footnotemark to keep writing after it.
A note consists in an entity
with length 1 at the position of the footnotemark, which is a character "N" on which we superpose a Chip
which is a CompositeDecorator
.
I have reproduced the problem in a Code Sandbox, which is focused only on the markers (there is no problem with the text content of the notes). Try writing some text and adding a footnotemark at the very end, it is impossible to place the selection after the footnotemark and keep writing, which is note the case if you place the footnotemark before the end of the text.
Any help will be greatly appreciated !!
I saw that jorgen posted a thread with a quite similar problem but I could not find a relevant answer there .
Thank you in advance.