diff --git a/web/src/components/MemoEditor.tsx b/web/src/components/MemoEditor.tsx index 12455cbd..7e852e2b 100644 --- a/web/src/components/MemoEditor.tsx +++ b/web/src/components/MemoEditor.tsx @@ -179,7 +179,12 @@ const MemoEditor = () => { } if (!isShiftKey && event.key === "Tab") { event.preventDefault(); + const selectedContent = editorRef.current.getSelectedContent(); + const cursorPosition = editorRef.current.getCursorPosition(); editorRef.current.insertText(" ".repeat(TAB_SPACE_WIDTH)); + if (selectedContent) { + editorRef.current.setCursorPosition(cursorPosition + TAB_SPACE_WIDTH); + } return; }