fix: three click selection paragraph boundary error #742

Co-authored-by: Hufe <huangyunfeihufe@hotmail.com>
This commit is contained in:
daria2023
2024-08-07 18:50:53 +08:00
committed by GitHub
co-authored by Hufe
parent dd1b53ee62
commit 9dd192ffd2
+4 -1
View File
@@ -195,7 +195,10 @@ function threeClick(host: CanvasEvent) {
} }
if (newStartIndex < 0) return if (newStartIndex < 0) return
let newEndIndex = index + downCount + 1 let newEndIndex = index + downCount + 1
if (elementList[newEndIndex]?.value === ZERO) { if (
elementList[newEndIndex]?.value === ZERO ||
newEndIndex > elementList.length - 1
) {
newEndIndex -= 1 newEndIndex -= 1
} }
rangeManager.setRange(newStartIndex, newEndIndex) rangeManager.setRange(newStartIndex, newEndIndex)