Skip to content

An AI-powered search engine with a generative UI

condition with trimmed input value

Anusha Yella17e646cf578d
diff --git a/components/chat-panel.tsx b/components/chat-panel.tsx
index 84b5c63f..b29d9ccf 100644
--- a/components/chat-panel.tsx
+++ b/components/chat-panel.tsx
@@ -115,7 +115,7 @@ export function ChatPanel({ messages }: ChatPanelProps) {
!e.nativeEvent.isComposing
) {
// Prevent the default action to avoid adding a new line
- if (input.length === 0) {
+ if (input.trim().length === 0) {
e.preventDefault()
return
}