Skip to content

Commit 8765636

Browse files
committed
selection preservation off by 1, fix #1367
1 parent e54a07f commit 8765636

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/quill.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -483,11 +483,11 @@ function shiftRange(range, index, length, source) {
483483
let start, end;
484484
if (index instanceof Delta) {
485485
[start, end] = [range.index, range.index + range.length].map(function(pos) {
486-
return index.transformPosition(pos, source === Emitter.sources.USER);
486+
return index.transformPosition(pos, source !== Emitter.sources.USER);
487487
});
488488
} else {
489489
[start, end] = [range.index, range.index + range.length].map(function(pos) {
490-
if (pos < index || (pos === index && source !== Emitter.sources.USER)) return pos;
490+
if (pos < index || (pos === index && source === Emitter.sources.USER)) return pos;
491491
if (length >= 0) {
492492
return pos + length;
493493
} else {

0 commit comments

Comments
 (0)