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

Prevent selection ranges to intersect once the model structure changes #6501

Closed
Reinmar opened this issue Mar 26, 2020 · 1 comment Β· Fixed by ckeditor/ckeditor5-engine#1834
Closed
Assignees
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.

Comments

@Reinmar
Copy link
Member

Reinmar commented Mar 26, 2020

πŸ“ Provide a description of the improvement

Visible in RemoveRowCommand's tests when you delete the fragment which prevents this error:

        βœ– should properly remove row if reversed selection is made
          Chrome 80.0.3987 (Mac OS X 10.15.2)
        CKEditorError: model-selection-range-intersects: Trying to add a range that intersects with another range in the selection. Read more: https://ckeditor.com/docs/ckeditor5/latest/framework/guides/support/error-codes.html#error-model-selection-range-intersects
         {"addedRange":{"start":{"root":"main","path":[0,0,0],"stickiness":"toNext"},"end":{"root":"main","path":[0,0,1],"stickiness":"toPrevious"}},"intersectingRange":{"start":{"root":"main","path":[0,0,0],"stickiness":"toNext"},"end":{"root":"main","path":[0,0,1],"stickiness":"toPrevious"}}}
            at LiveSelection._checkRange (webpack:///./packages/ckeditor5-engine/src/model/selection.js?:767:11)
            at LiveSelection._prepareRange (webpack:///./packages/ckeditor5-engine/src/model/documentselection.js?:832:8)
            at LiveSelection._fixGraveyardSelection (webpack:///./packages/ckeditor5-engine/src/model/documentselection.js?:1154:26)
            at Model.LiveSelection.listenTo.priority (webpack:///./packages/ckeditor5-engine/src/model/documentselection.js?:646:10)
            at Model.fire (webpack:///./packages/ckeditor5-utils/src/emittermixin.js?:218:30)
            at Model.<computed> [as applyOperation] (webpack:///./packages/ckeditor5-utils/src/observablemixin.js?:263:16)
            at applyRemoveOperation (webpack:///./packages/ckeditor5-engine/src/model/writer.js?:1564:8)
            at Writer.remove (webpack:///./packages/ckeditor5-engine/src/model/writer.js?:549:4)
            at RemoveRowCommand._removeRow (webpack:///./packages/ckeditor5-table/src/commands/removerowcommand.js?:140:10)
            at Object.eval [as callback] (webpack:///./packages/ckeditor5-table/src/commands/removerowcommand.js?:81:10)

This is due to rows being removed and ranges from the selection falling into one place.

May be related to #3504. @scofalik may be proud of himself for foreseeing this.


If you'd like to see this improvement implemented, add a πŸ‘ reaction to this post.

@Reinmar Reinmar added type:improvement This issue reports a possible enhancement of an existing feature. package:engine labels Mar 26, 2020
@Reinmar Reinmar added this to the iteration 31 milestone Mar 26, 2020
@Reinmar
Copy link
Member Author

Reinmar commented Mar 26, 2020

May also resolve #6382.

@jodator jodator self-assigned this Mar 30, 2020
Reinmar added a commit to ckeditor/ckeditor5-engine that referenced this issue Apr 14, 2020
Fix: Intersecting ranges resulting when fixing graveyard selection no longer break the editor. Closes ckeditor/ckeditor5#6501. Closes ckeditor/ckeditor5#6382.
Reinmar added a commit to ckeditor/ckeditor5-table that referenced this issue Apr 14, 2020
Other: Removed temporary fixes for `model-selection-range-intersects` errors. See ckeditor/ckeditor5#6501. See ckeditor/ckeditor5#6382.
mlewand pushed a commit that referenced this issue May 1, 2020
Fix: Intersecting ranges resulting when fixing graveyard selection no longer break the editor. Closes #6501. Closes #6382.
mlewand pushed a commit that referenced this issue May 1, 2020
Other: Removed temporary fixes for `model-selection-range-intersects` errors. See #6501. See #6382.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package:engine type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants