remove on cursor move

This commit is contained in:
Michael Freno
2025-12-26 16:18:22 -05:00
parent 15a3167dc9
commit b693edac8c

View File

@@ -1363,6 +1363,11 @@ export default function TextEditor(props: TextEditorProps) {
}); });
}, },
onSelectionUpdate: ({ editor }) => { onSelectionUpdate: ({ editor }) => {
// Clear suggestion when cursor moves (click/arrow keys without suggestion)
if (currentSuggestion()) {
setCurrentSuggestion("");
}
// Force reactive update for button states // Force reactive update for button states
setEditorState((prev) => prev + 1); setEditorState((prev) => prev + 1);