Closed marijnh closed 6 years ago
Because we're trying to mimic something that has gone before the first para is actually exactly what we want (and should be being handled by the plugin). It'd probably be reasonable to allow this to be configured. Although the difference between browsers is obviously not intended so will look into that thanks.
I actually looked at the footnote demo as a starting point for this but it seemed slightly complex and didn't work with multiple "layers" of notes - but I may be missing something.
I've actually implemented some functionality that allows you to cursor in / out of a note (thanks to your changes over the last few days @marijnh !) so this should now be fixed in the sense the behaviour is different but consistent.
It seems it'll always insert the text before the boundary, so if you type with the cursor at the start of a note, the text ends up before the note, and if you type after the end of a node, the text goes into the note.
(In Chrome I'm actually also seeing the first problem, at the start of notes, but not the second.)
Since you are using marks to model notes, I guess ProseMirror itself doesn't even see a difference between positions inside and outside of the note. And browsers themselves can't really be trusted to do anything right when it comes to inserting text at inline node boundaries.
I'm unsure what the proper solution to this issue would look like. You could make these inline nodes with their own embedded editor (something like the footnote demo), but that does sound a little heavyweight.