Skip to content

Commit

Permalink
fix: windows emoji picker selection
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszGrajdek committed Aug 2, 2024
1 parent 3486303 commit 17fd595
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -293,13 +293,15 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
}

const prevSelection = contentSelection.current ?? {start: 0, end: 0};
const newCursorPosition = Math.max(Math.max(contentSelection.current.end, 0) + (parsedText.length - previousText.length), 0);

if (compositionRef.current && !BrowserUtils.isMobile) {
divRef.current.value = parsedText;
compositionRef.current = false;
contentSelection.current.end = newCursorPosition;
return;
}

const newCursorPosition = Math.max(Math.max(contentSelection.current.end, 0) + (parsedText.length - previousText.length), 0);
let newInputUpdate: ParseTextResult;
switch (inputType) {
case 'historyUndo':
Expand Down

0 comments on commit 17fd595

Please sign in to comment.