Undoing content inserted within a paragraph results in an error caused by a bad position path during the undo transformation #17267
Labels
package:engine
squad:collaboration
Issue to be handled by the Collaboration team.
type:bug
This issue reports a buggy (incorrect) behavior.
Milestone
📝 Provide detailed reproduction steps (if any)
model.change(() => model.insertContent(...))
to insert two document fragments in the middle of a paragraphundo
command twiceundo
command, an error is thrown:CKEditorError: model-position-path-incorrect-format {"path":[]}
See my test case here which throws this error.
✔️ Expected result
No error is thrown and both changes are undone successfully.
❌ Actual result
An error is thrown:
CKEditorError: model-position-path-incorrect-format {"path":[]}
❓ Possible solution
In my debugging, it seems like a bad path is getting created during the undo operation transformation. Even though the editor model only has one paragraph in it, an operation position is getting transformed into a position with the path
[26]
. I traced the bad path back to this transformation function which calls Position._getTransformedByMove, with the bad path ultimately getting created in Position._getCombined. After playing around with this a bit, I'm not exactly sure how to fix this so the positions get transformed correctly however this seems to be the location where the bad path is originally coming from.📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: