diff --git a/app/soapbox/features/chats/components/chat-window.tsx b/app/soapbox/features/chats/components/chat-window.tsx index 356669917..5a71f6598 100644 --- a/app/soapbox/features/chats/components/chat-window.tsx +++ b/app/soapbox/features/chats/components/chat-window.tsx @@ -58,7 +58,6 @@ const ChatWindow: React.FC = ({ idx, chatId, windowState }) => { const handleInputRef = (el: HTMLTextAreaElement) => { inputElem.current = el; - focusInput(); }; const focusInput = () => { @@ -66,8 +65,10 @@ const ChatWindow: React.FC = ({ idx, chatId, windowState }) => { }; useEffect(() => { - focusInput(); - }, [windowState === 'open']); + if (windowState === 'open') { + focusInput(); + } + }, [windowState]); if (!chat) return null; const account = chat.account as unknown as AccountEntity;