Fix many cursors showing up in deletes in the example website

This commit is contained in:
Andras Schmelczer 2025-07-13 09:28:39 +01:00
parent 8911f88157
commit d87dd58b60
No known key found for this signature in database
GPG key ID: FC8F2C3D3D1A718C

View file

@ -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++;
}