Skip to content

Fixes for TaskListItemExtension#482

Open
nthsense wants to merge 3 commits intomarekdedic:masterfrom
nthsense:fix-tasklistitem
Open

Fixes for TaskListItemExtension#482
nthsense wants to merge 3 commits intomarekdedic:masterfrom
nthsense:fix-tasklistitem

Conversation

@nthsense
Copy link
Contributor

When trying to use TaskListItemExtension in my own project, I was getting RangeErrors from ProseMirror when creating the task list item and also when executing the Backspace handler. I believe these were due to differences in the structure of my document vs the structure that the TaskListItemExtension was expecting. The approach I am taking here uses built in methods of ProseMirror to calculate the start and end positions for replacement and will hopefully be resilient to more edge cases.

Additionally, I found that adding the Enter, Shift-Tab, and Tab behaviors make task lists a lot nicer to work with. I have included those changes in a separate commit however, so they can be applied separately.

I also would propose removing the Backspace behavior, since things seem to work in a more standard way if I take it out - however, I am simply fixing it for now.

@marekdedic
Copy link
Owner

Hi,
thanks for the PR! As a first look the changes make sense to me, but I haven't tested them locally with an actual editor yet.

@nthsense The CI is failing, can you fix it, please?
@Sec-ant Does this fix the errors caused by marekdedic/prosemirror-unified#453 ? Could you review this as well, please? I feel like you understand these bits better than me...

@nthsense
Copy link
Contributor Author

@marekdedic On it, thanks. I don't think this will fix the issues caused by marekdedic/prosemirror-unified#453, I believe those are separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants