diff --git a/web/src/components/MemoEditor/index.tsx b/web/src/components/MemoEditor/index.tsx index 06ecbd1f5..0dca58f3b 100644 --- a/web/src/components/MemoEditor/index.tsx +++ b/web/src/components/MemoEditor/index.tsx @@ -488,6 +488,9 @@ const MemoEditor = observer((props: Props) => { editorRef.current.insertText("\n"); editorRef.current.insertText(`#${tag} `); + // Scroll to the bottom to show the newly added tag + editorRef.current.scrollToCursor(); + // Remove the tag from recommendations after adding it setState((prevState) => ({ ...prevState, @@ -514,6 +517,9 @@ const MemoEditor = observer((props: Props) => { const tagsText = state.recommendedTags.map((tagSuggestion) => `#${tagSuggestion.tag}`).join(" ") + " "; editorRef.current.insertText(tagsText); + // Scroll to the bottom to show the newly added tags + editorRef.current.scrollToCursor(); + // Clear recommendations setState((prevState) => ({ ...prevState,