Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

Move selection mark/cursor to end of markdown once done processing

Lynette Lopez1e0614ff5657
diff --git a/libs/components/common/src/lib/text/EditableText.tsx b/libs/components/common/src/lib/text/EditableText.tsx
index 57509e9379..ba7ffad621 100644
--- a/libs/components/common/src/lib/text/EditableText.tsx
+++ b/libs/components/common/src/lib/text/EditableText.tsx
@@ -552,8 +552,8 @@ export const Text = forwardRef<ExtendedTextUtils, TextProps>((props, ref) => {
}
// markdown interception
if (supportMarkdown && handleMarkdown(e)) {
- const start_selection = utils.current.getStartSelection();
- utils.current.setSelection(start_selection);
+ const endOfMarkdown = utils.current.getEndSelection();
+ utils.current.setSelection(endOfMarkdown);
e.preventDefault();
return true;
}