Skip to content

Commit

Permalink
fix cursor positioning when setting new value
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Feb 6, 2024
1 parent c698ea7 commit 567e184
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/MarkdownTextInput.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -426,13 +426,7 @@ const MarkdownTextInput = React.forwardRef<TextInput, MarkdownTextInputProps>(
}

const text = processedValue !== undefined ? processedValue : '';
if ((divRef.current as unknown as TextInput).isFocused()) {
contentSelection.current = {
start: text.length,
end: text.length,
};
}
parseText(divRef.current, text, processedMarkdownStyle);
parseText(divRef.current, text, processedMarkdownStyle, text.length);
updateTextColor(divRef.current, value);
}, [multiline, processedMarkdownStyle, processedValue]);

Expand Down

0 comments on commit 567e184

Please sign in to comment.