From 27f9f20fe30d86ac87d3dedae73e05b40207b9ea Mon Sep 17 00:00:00 2001 From: Rafi-Microsoft Date: Mon, 16 Jun 2025 18:13:14 +0530 Subject: [PATCH 1/2] Disable send button when input is empty or contains only spaces --- App/frontend-app/src/components/chat/chatRoom.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/App/frontend-app/src/components/chat/chatRoom.tsx b/App/frontend-app/src/components/chat/chatRoom.tsx index 737229c2..da1ee7a7 100644 --- a/App/frontend-app/src/components/chat/chatRoom.tsx +++ b/App/frontend-app/src/components/chat/chatRoom.tsx @@ -583,6 +583,7 @@ export function ChatRoom({ searchResultDocuments, selectedDocuments, chatWithDoc placeholder={t('components.chat.input-placeholder')} disabled={isLoading} onSubmit={handleSend} + disableSend = {textAreaValue.trim().length === 0 || isLoading} contentAfter={undefined} /> From 9b125684ab330989e0569f13a976ccef30e41384 Mon Sep 17 00:00:00 2001 From: Prasanjeet-Microsoft Date: Tue, 17 Jun 2025 00:25:24 +0530 Subject: [PATCH 2/2] fixed - reset chat input character count on "New Topic" button click --- App/frontend-app/src/components/chat/chatRoom.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/App/frontend-app/src/components/chat/chatRoom.tsx b/App/frontend-app/src/components/chat/chatRoom.tsx index 737229c2..a0922db3 100644 --- a/App/frontend-app/src/components/chat/chatRoom.tsx +++ b/App/frontend-app/src/components/chat/chatRoom.tsx @@ -73,6 +73,7 @@ export function ChatRoom({ searchResultDocuments, selectedDocuments, chatWithDoc }); const [referencesForFeedbackForm, setReferencesForFeedbackForm] = useState([]); const [textAreaValue, setTextAreaValue] = useState(""); + const [textareaKey, setTextareaKey] = useState(0); const inputRef = useRef(null); const [allChunkTexts, setAllChunkTexts] = useState([]); @@ -568,12 +569,15 @@ export function ChatRoom({ searchResultDocuments, selectedDocuments, chatWithDoc setSelectedDocument([]); setIsLoading(false); setChatSessionId(null); + setTextAreaValue(""); + setTextareaKey(prev => prev + 1); }} > {t('components.chat.new-topic')}