From d87dd58b606199454e200ade21b5c69933bc1880 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Sun, 13 Jul 2025 09:28:39 +0100 Subject: [PATCH] Fix many cursors showing up in deletes in the example website --- examples/website/src/index.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/website/src/index.ts b/examples/website/src/index.ts index 43f1a3b..c6ca70b 100644 --- a/examples/website/src/index.ts +++ b/examples/website/src/index.ts @@ -110,13 +110,14 @@ function updateMergedText(): void { fragment.appendChild(span); - if (currentPosition === selectionEnd - 1) { + const isDelete = history === 'RemovedFromLeft' || history === 'RemovedFromRight'; + if (currentPosition === selectionEnd - 1 && !isDelete) { fragment.appendChild( createSelectionOverlay(selectionSide === 'left', isSelection) ); } - if (history !== 'RemovedFromLeft' && history !== 'RemovedFromRight') { + if (!isDelete) { // Only increment currentPosition for non-removed characters currentPosition++; }