Prosemirror: splitListItem does not split the list when cursor is at the end of the list item

Created on 5 Jul 2017  路  5Comments  路  Source: ProseMirror/prosemirror

This behavior has been introduced in 0.22.1.
splitlistitem

Steps to reproduce:
1) create a list item with some text
2) put cursor at the end of the text
3) press Enter

Expected: it should create a new list item
Actual: it creates a new paragraph within the same list item

If that's expected, then it is a breaking change since 0.21.0 and should be documented I think.

Most helpful comment

Definitely not expected. I'll look into it later.

All 5 comments

It's more natural behaviour that when I hit enter, it would start a new list item. Google doc and dropbox paper are doing the same.

Definitely not expected. I'll look into it later.

like I said before, one way to fix that would be to make the following change inside canSplit method
let after = (typesAfter && typesAfter[i]) || node

That was indeed the problem, fixed in attached patch and released as prosemirror-transform 0.22.2

Oh, I meant this patch

Was this page helpful?
0 / 5 - 0 ratings