Skip to content

Commit

Permalink
Merge pull request #45120 from Expensify/vit-44262fix
Browse files Browse the repository at this point in the history
[NoQA] Correct the react-native-live-markdown patch after updating the library
  • Loading branch information
AndrewGable authored Jul 9, 2024
2 parents 9dc762d + f66caf4 commit 0f25883
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 0 additions & 13 deletions patches/@expensify+react-native-live-markdown+0.1.88.patch

This file was deleted.

13 changes: 13 additions & 0 deletions patches/@expensify+react-native-live-markdown+0.1.91.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/node_modules/@expensify/react-native-live-markdown/src/web/cursorUtils.ts b/node_modules/@expensify/react-native-live-markdown/src/web/cursorUtils.ts
index 1cda659..ba5c3c3 100644
--- a/node_modules/@expensify/react-native-live-markdown/src/web/cursorUtils.ts
+++ b/node_modules/@expensify/react-native-live-markdown/src/web/cursorUtils.ts
@@ -66,7 +66,7 @@ function setCursorPosition(target: HTMLElement, start: number, end: number | nul
// 3. Caret at the end of whole input, when pressing enter
// 4. All other placements
if (prevChar === '\n' && prevTextLength !== undefined && prevTextLength < textCharacters.length) {
- if (nextChar !== '\n') {
+ if (nextChar && nextChar !== '\n' && i !== n - 1) {
range.setStart(textNodes[i + 1] as Node, 0);
} else if (i !== textNodes.length - 1) {
range.setStart(textNodes[i] as Node, 1);

0 comments on commit 0f25883

Please sign in to comment.