Fix many cursors showing up in deletes in the example website
This commit is contained in:
parent
8911f88157
commit
d87dd58b60
1 changed files with 3 additions and 2 deletions
|
|
@ -110,13 +110,14 @@ function updateMergedText(): void {
|
||||||
|
|
||||||
fragment.appendChild(span);
|
fragment.appendChild(span);
|
||||||
|
|
||||||
if (currentPosition === selectionEnd - 1) {
|
const isDelete = history === 'RemovedFromLeft' || history === 'RemovedFromRight';
|
||||||
|
if (currentPosition === selectionEnd - 1 && !isDelete) {
|
||||||
fragment.appendChild(
|
fragment.appendChild(
|
||||||
createSelectionOverlay(selectionSide === 'left', isSelection)
|
createSelectionOverlay(selectionSide === 'left', isSelection)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (history !== 'RemovedFromLeft' && history !== 'RemovedFromRight') {
|
if (!isDelete) {
|
||||||
// Only increment currentPosition for non-removed characters
|
// Only increment currentPosition for non-removed characters
|
||||||
currentPosition++;
|
currentPosition++;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue