Fix selection-finding in joinBackward #5

Merged
ahixon merged 1 commit from master into master 2018-04-09 12:08:28 +02:00
ahixon commented 2018-04-06 03:43:15 +02:00 (Migrated from github.com)

Similar fix from https://github.com/ProseMirror/prosemirror/issues/783, but for joinBackward as well

Similar fix from https://github.com/ProseMirror/prosemirror/issues/783, but for `joinBackward` as well
marijnh commented 2018-04-06 08:48:59 +02:00 (Migrated from github.com)

Thanks. Did you manage to trigger the problem? At a glance, the code looks pretty safe (delete from $cursor.before() to $cursor.after(), and then re-resolve $cursor.before()) and doesn't have the problem that joinForward had (where it used a resolved position from the old document).

Thanks. Did you manage to trigger the problem? At a glance, the code looks pretty safe (delete from `$cursor.before()` to `$cursor.after()`, and then re-resolve `$cursor.before()`) and doesn't have the problem that `joinForward` had (where it used a resolved position from the old document).
ahixon commented 2018-04-09 04:10:12 +02:00 (Migrated from github.com)

https://kindhearted-trout.glitch.me/ should trigger the problem (editable version at https://glitch.com/edit/#!/kindhearted-trout).

Backspace the last paragraph until all that's left is an empty li, then backspace the empty list item.

You should get a RangeError: Position 104 out of range.

https://kindhearted-trout.glitch.me/ should trigger the problem (editable version at https://glitch.com/edit/#!/kindhearted-trout). Backspace the last paragraph until all that's left is an empty li, then **backspace the empty list item**. You should get a `RangeError: Position 104 out of range`.
marijnh commented 2018-04-09 12:09:14 +02:00 (Migrated from github.com)

Ah, I see, when the parent is removed as well you could still get a bogus position. Makes sense. Merged and released as 1.0.7.

Ah, I see, when the parent is removed as well you could still get a bogus position. Makes sense. Merged and released as 1.0.7.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-commands!5
No description provided.