-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
📝 Provide detailed reproduction steps (if any)
- Use
model.change(() => model.insertContent(...))to insert two document fragments in the middle of a paragraph - Execute the
undocommand twice - On the second
undocommand, 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
- Browser: Chrome v130
- OS: MacOS
- First affected CKEditor version: unknown
- Installed CKEditor plugins: ckeditor5-undo
If you'd like to see this fixed sooner, add a 👍 reaction to this post.