diff --git a/frontend/src/components/chat/MessageComposer/VoiceButton.tsx b/frontend/src/components/chat/MessageComposer/VoiceButton.tsx index b7a98f4bfc..71cbb4da27 100644 --- a/frontend/src/components/chat/MessageComposer/VoiceButton.tsx +++ b/frontend/src/components/chat/MessageComposer/VoiceButton.tsx @@ -27,7 +27,13 @@ const VoiceButton = ({ disabled }: Props) => { useHotkeys( 'p', - () => { + (e: KeyboardEvent) => { + const target = (e?.target as HTMLElement) || null; + const tagName = target?.tagName; + const isTyping = + tagName === 'INPUT' || tagName === 'TEXTAREA' || target?.isContentEditable; + if (isTyping) return; + if (!isEnabled) return; if (audioConnection === 'on') return endConversation(); return startConversation();