Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when merging paragraphs and undo #8976

Closed
FilipTokarski opened this issue Feb 2, 2021 · 2 comments · Fixed by #9003
Closed

Error when merging paragraphs and undo #8976

FilipTokarski opened this issue Feb 2, 2021 · 2 comments · Fixed by #9003
Assignees
Labels
package:engine package:undo type:bug This issue reports a buggy (incorrect) behavior.

Comments

@FilipTokarski
Copy link
Member

📝 Provide detailed reproduction steps (if any)

  1. Open any editor
  2. Create two paragraphs with text content
  3. Merge them by putting cursor at the beginning of the second one and pressing backspace
  4. Delete the whole new paragraph
  5. undo 4 times

✔️ Expected result

Undo works without errors. Content looks like in step 2

❌ Actual result

Console error:

Uncaught CKEditorError: merge-operation-target-position-invalid
Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-merge-operation-target-position-invalid
    at MergeOperation._validate (http://localhost:8125/ckeditor5/tests/manual/all-features.js:61573:10)
    at Model.on.priority (http://localhost:8125/ckeditor5/tests/manual/all-features.js:59082:14)
    at Model.fire (http://localhost:8125/ckeditor5/tests/manual/all-features.js:156788:30)
    at Model.<computed> [as applyOperation] (http://localhost:8125/ckeditor5/tests/manual/all-features.js:159187:16)
    at UndoCommand._undo (http://localhost:8125/ckeditor5/tests/manual/all-features.js:150692:11)
    at Object.callback (http://localhost:8125/ckeditor5/tests/manual/all-features.js:151010:9)
    at Model._runPendingChanges (http://localhost:8125/ckeditor5/tests/manual/all-features.js:59821:58)
    at Model.enqueueChange (http://localhost:8125/ckeditor5/tests/manual/all-features.js:59227:10)
    at UndoCommand.execute (http://localhost:8125/ckeditor5/tests/manual/all-features.js:151009:21)
    at UndoCommand.<anonymous> (http://localhost:8125/ckeditor5/tests/manual/all-features.js:159183:32)

Screencast

0_undo1.mp4

📃 Other details

  • Browser: any
  • First affected CKEditor version: very old, even on version 15

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@FilipTokarski FilipTokarski added type:bug This issue reports a buggy (incorrect) behavior. package:undo labels Feb 2, 2021
@scofalik
Copy link
Contributor

scofalik commented Feb 2, 2021

Could you check if it works on i/8870?

@FilipTokarski FilipTokarski changed the title Error when merging text content and undo Error when merging paragraphs and undo Feb 2, 2021
@FilipTokarski
Copy link
Member Author

Actually, I found it when testing i/8870

@niegowski niegowski self-assigned this Feb 5, 2021
@niegowski niegowski added this to the iteration 40 milestone Feb 5, 2021
scofalik added a commit that referenced this issue Feb 17, 2021
Fix (engine): Undoing the deletion of merged paragraphs should result in the original tree. Closes #8976.

Internal (engine): The `SplitOperation` is now expecting `insertionPosition` as a constructor argument.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine package:undo type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants