ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.59k stars 335 forks source link

Editor jumps to middle of list when focusing on long nested list #1405

Closed davatron5000 closed 1 year ago

davatron5000 commented 1 year ago

A customer of mine brought up a weird situation they had when editing content with a very long nested list that was causing a page jump. I was unable to stop Prosemirror from performing the jump.

If there's a workaround for this I'd love to know. Thanks.

Environment

Steps to repro

  1. Go to https://prosemirror.net homepage.
  2. In ProseMirror, create a paragraph of text and a long list (~25 items). List must contain at least one nested list item.
  3. At the end of the paragraph above the long list, hit the Delete key (once or twice)

Actual Results

Expected Results

Demo

[Sample Text] Extremely long list - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem - listItem
marijnh commented 1 year ago

Attached patch should help with this.

davatron5000 commented 1 year ago

Thanks so much, @marijnh 🎉