It looks like, because no commands bound to backspace apply in this situation, the editor doesn’t call preventDefault on the event, and the browser’s native behavior steps in, which seems to be to delete those wrapping spans, for some reason. Falling back to built-in browser behavior when no key bindings override a key is part of ProseMirror’s intentional, expected behavior, so in a case like this you’re going to have to work around this with a custom command, bound to backspace but with lower precedence than other bindings, that always returns true.
@marijn Okay. But I feel this is not a browser’s native behaviour - deleting the wrapping spans.
I have experienced the same behaviour when pasting rich text to the editor.
As you can see, when the first <p> contains the spans, after paste, it’s gone. But only when the second <p> contains the spans, it’s retained.
I encountered this, when I copy and paste content from Google docs. To overcome it, I had to add an empty <p> in the starting. But as soon as that one is deleted, the spans from the second <p> is removed as in the first demo video.