Skip to content

Commit

Permalink
fix: three click selection paragraph boundary error #742
Browse files Browse the repository at this point in the history
Co-authored-by: Hufe <huangyunfeihufe@hotmail.com>
  • Loading branch information
daria2023 and Hufe921 authored Aug 7, 2024
1 parent dd1b53e commit 9dd192f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/editor/core/event/handlers/click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,10 @@ function threeClick(host: CanvasEvent) {
}
if (newStartIndex < 0) return
let newEndIndex = index + downCount + 1
if (elementList[newEndIndex]?.value === ZERO) {
if (
elementList[newEndIndex]?.value === ZERO ||
newEndIndex > elementList.length - 1
) {
newEndIndex -= 1
}
rangeManager.setRange(newStartIndex, newEndIndex)
Expand Down

0 comments on commit 9dd192f

Please sign in to comment.