You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DocumentSelection contains live ranges. Every live range is updated at model#applyOperation. Then, when it's updated, on change:range document selection validates that new range positions are correct.
This works fine with a single range in the selection, but it breaks badly with multiple ranges, because this happens:
First selection range gets updated on model#applyOperation.
This triggers range1#change:range (BTW, this event name is a bit odd).
This is delegated to selection#change:range.
On selection#change:range the selection starts validating its ranges.
All ranges... at once. So, also the second range which wasn't updated yet.
It seems to me that the selection should validate only the range which has changed.
I guess it is better to validate only the changed range. DocumentSelection#event:change:range should get the range that has changed.
BTW. There's one more caveat to it, which has a very old issue. If you have two ranges in selection and move content with the one range into the other range, you'll have incorrect state in a selection (where one range includes the other one). But this is not urgent.
DocumentSelection
contains live ranges. Every live range is updated atmodel#applyOperation
. Then, when it's updated, onchange:range
document selection validates that new range positions are correct.This works fine with a single range in the selection, but it breaks badly with multiple ranges, because this happens:
model#applyOperation
.range1#change:range
(BTW, this event name is a bit odd).selection#change:range
.selection#change:range
the selection starts validating its ranges.It seems to me that the selection should validate only the range which has changed.
cc @scofalik
The text was updated successfully, but these errors were encountered: