Skip to content

Commit

Permalink
fix: fix issue when input in richtext
Browse files Browse the repository at this point in the history
  • Loading branch information
neuqzxy committed Dec 17, 2024
1 parent c4d9990 commit 5b5e7ed
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ export function findConfigIndexByCursorIdx(textConfig: IRichTextCharacter[], cur
break;
}
}
if (cursorIndex - Math.round(cursorIndex) < 0) {
// 换行符永远往前走一格
if (cursorIndex - Math.round(cursorIndex) < 0 || (textConfig[index] as IRichTextParagraphCharacter).text === '\n') {
index--;
}
index = Math.max(index, 0);
Expand Down

0 comments on commit 5b5e7ed

Please sign in to comment.