Allow text selection in leaf NodeViews

By default, the editor treats all events in the editor as ‘belonging’ to the editor, and will handle them just like it handles events in all the rest of the editable content. You can tweak this with the stopEvent method on your node view—when that returns true for a certain event, the editor itself will ignore it. But getting separate selection to work inside a node is a bit more involved, since to the editor that looks exactly like in-editor selection, and it’ll try to sync the DOM selection with its selection state. As you found, when the element is focusable through contenteditable=true, that shows ProseMirror that it doesn’t ‘own’ the selection, and will cause it leave it alone. You can make something focusable without making it editable by giving it a tabindex=-1 attribute.