Merge pull request #468 from lynettelopez/fix/move-cursor-to-end-of-markdown

Fix: Move cursor to end of markdown
This commit is contained in:
DarkSky
2022-09-29 23:10:05 +08:00
committed by GitHub

View File

@@ -551,9 +551,9 @@ export const Text = forwardRef<ExtendedTextUtils, TextProps>((props, ref) => {
} }
} }
// markdown interception // markdown interception
if (supportMarkdown && !!handleMarkdown(e)) { if (supportMarkdown && handleMarkdown(e)) {
const start_selection = utils.current.getStartSelection(); const endOfMarkdown = utils.current.getEndSelection();
utils.current.setSelection(start_selection); utils.current.setSelection(endOfMarkdown);
e.preventDefault(); e.preventDefault();
return true; return true;
} }