Hi, I have a schema where I defined a custom inline node. It just a span with a class and text content. When that custom node is the only one node in the line and when I hit backspace at the beginning of it, its raised to the previous line and converted to text. It would not happen if it contained another node like simple text next to it. Is there a way to prevent that? I tried to research the backspace command but there are so many going on and maybe someone could hint me?
Non-atomic inline nodes are not something the default commands handle well (because it is often unclear how they should be handled). In this case, joinBackward
is returning false, letting the browser’s default backspace handling go through. Firefox does pretty much what you seem to be expecting, but Chrome strips off the span for some reason.
The solution will be to write your own custom backspace handler that takes effect when the cursor is inside your inline node.
I see, thanks. I will investigate on that and provide eventual result of my attempts for those who will seek later