diff --git a/memento-note/components/rich-text-editor.tsx b/memento-note/components/rich-text-editor.tsx index 3046925..c4ceb9b 100644 --- a/memento-note/components/rich-text-editor.tsx +++ b/memento-note/components/rich-text-editor.tsx @@ -483,10 +483,11 @@ function SlashCommandMenu({ editor, onInsertImage }: { editor: Editor; onInsertI ref={menuRef} className="notion-slash-menu" style={{ top: coords.top, left: coords.left }} - onMouseDown={() => { - // Block selectionUpdate handler while interacting with menu + onMouseDown={(e) => { + e.preventDefault() // prevent editor from losing focus + e.stopPropagation() // prevent ProseMirror from seeing the mousedown → no selectionUpdate menuInteracting.current = true - setTimeout(() => { menuInteracting.current = false }, 200) + setTimeout(() => { menuInteracting.current = false }, 300) }} onClick={(e) => e.stopPropagation()} >