Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1203d62

Browse files
rlinozOSBotify
authored andcommittedJun 21, 2024··
Merge pull request #44168 from nkdengineer/fix/44085
[CP Staging]fix: crash app when entering mention. (cherry picked from commit 0d147a4)
1 parent 9183844 commit 1203d62

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/node_modules/@expensify/react-native-live-markdown/lib/module/web/cursorUtils.js b/node_modules/@expensify/react-native-live-markdown/lib/module/web/cursorUtils.js
2+
index e975fb2..6a4b510 100644
3+
--- a/node_modules/@expensify/react-native-live-markdown/lib/module/web/cursorUtils.js
4+
+++ b/node_modules/@expensify/react-native-live-markdown/lib/module/web/cursorUtils.js
5+
@@ -53,7 +53,7 @@ function setCursorPosition(target, start, end = null) {
6+
// 3. Caret at the end of whole input, when pressing enter
7+
// 4. All other placements
8+
if (prevChar === '\n' && prevTextLength !== undefined && prevTextLength < textCharacters.length) {
9+
- if (nextChar !== '\n') {
10+
+ if (nextChar !== '\n' && i !== n - 1 && nextChar) {
11+
range.setStart(textNodes[i + 1], 0);
12+
} else if (i !== textNodes.length - 1) {
13+
range.setStart(textNodes[i], 1);

0 commit comments

Comments
 (0)
Please sign in to comment.