Suitable backspace command for lists with restricted schema?

Hello I’m facing a very similar issue as the listItem equivalent for me has content like this paragraph bullet_list? instead of paragraph block*

Having this restriction has two main undesirable effects in our case

  • the enter key pressed at the end of the line no longer create a new node (which may be a totally different issues)
  • more important the backspace key press when the cursor is at the beginning of a list_item starts behaving very oddly.

backspace-restricted-list

The only key being pressed here is the backspace key.

I’m not exactly surprised that the list item got converted into <ul><li> since the content does mention paragraph list_item? but even so on 2nd backspace press the earlier entry’s whole paragraph content ‘ab’ gets selected. Is this expected?

Ideally I would want the text to just get merged with the paragraph ‘ab’ so that on backspace the scheme becomes

  • ab12
  • 34 since having backspace act like a ‘tab’ or indent command might be a little confusing to the users.

I’m quite willing to write a custom command for the backspace bindings is that is what is recommended but I thought to mention here since the issue seems somewhat related to me.

If custom bindings are suggested, what would be the best way to approach it? Should I base it on the prosemirror-schema-list commands?