Skip to content

Commit

Permalink
Fix cursor positioning on android on markdown style change (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid authored Apr 25, 2024
1 parent 8da3794 commit 4f9d790
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ protected void setMarkdownStyle(MarkdownStyle markdownStyle) {
mMarkdownUtils.setMarkdownStyle(mMarkdownStyle);
}
if (mReactEditText != null) {
int selectionStart = mReactEditText.getSelectionStart();
int selectionEnd = mReactEditText.getSelectionEnd();
mReactEditText.setText(mReactEditText.getText()); // trigger update
mReactEditText.setSelection(selectionStart, selectionEnd);
}
}
}

0 comments on commit 4f9d790

Please sign in to comment.