For such a list:
- A
- B
- C
- B
When I put the cursor before B and then keep pressing backspace, I will quickly enter an infinite loop between “The top-level list item is selected” and “The cursor goes back to the front of B” without actually delete anything.
Users would expect that Backspace can delete something in general, so I think the current behavior can be improved.
The Backspace key is binding to chainCommands(deleteSelection, joinBackward, selectNodeBackward)
. I don’t understand the underlying of joinBackward
, but obviously it returns false
in our case, which causes A
to be selected.
One possible solution that comes to me is to call liftListItem
before calling joinBackward
. By doing that, joinBackward
will return true
. But I’m not sure if this is a suitable solution.