Skip to content

Commit e78bb23

Browse files
fix(textarea): handle command mention better
Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
1 parent 044b6a8 commit e78bb23

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

webview-ui/src/components/chat/ChatTextArea.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,12 @@ export const ChatTextArea = forwardRef<LexicalEditor, ChatTextAreaProps>(
413413
setSelectedMenuIndex(-1)
414414
setInputValue("")
415415
setShowContextMenu(false)
416-
const commandMention = `/${value}`
416+
if (type === ContextMenuOptionType.Command && value) {
417+
setSelectedMenuIndex(-1)
418+
setShowContextMenu(false)
419+
mentionPluginRef.current?.insertMention(value, "/", ContextMenuOptionType.Command)
420+
return
421+
}
417422
setInputValue(commandMention + " ")
418423
return
419424
}

0 commit comments

Comments
 (0)