diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 99b2d2e0b7..5704a67c83 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -243,7 +243,7 @@ export const ChatTextArea = forwardRef( }, [selectedType, searchQuery]) const handleEnhancePrompt = useCallback(() => { - const trimmedInput = inputValue.trim() + const trimmedInput = (inputValue || "").trim() if (trimmedInput) { setIsEnhancingPrompt(true) @@ -257,7 +257,7 @@ export const ChatTextArea = forwardRef( // Memoized check for whether the input has content (text or images) const hasInputContent = useMemo(() => { - return inputValue.trim().length > 0 || selectedImages.length > 0 + return (inputValue || "").trim().length > 0 || selectedImages.length > 0 }, [inputValue, selectedImages]) // Compute the key combination text for the send button tooltip based on enterBehavior