From bde21f2a3a8a7043d0c55f69bb9ab1259f5cf05a Mon Sep 17 00:00:00 2001 From: Steve Androulakis Date: Sat, 4 Jan 2025 16:14:00 -0800 Subject: [PATCH] input bar select fix --- frontend/src/pages/App.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/pages/App.jsx b/frontend/src/pages/App.jsx index b8c3d83..7e9747d 100644 --- a/frontend/src/pages/App.jsx +++ b/frontend/src/pages/App.jsx @@ -6,6 +6,7 @@ const POLL_INTERVAL = 500; // 0.5 seconds export default function App() { const containerRef = useRef(null); + const inputRef = useRef(null); const [conversation, setConversation] = useState([]); const [userInput, setUserInput] = useState(""); const [loading, setLoading] = useState(false); @@ -87,6 +88,12 @@ export default function App() { } }, [conversation, loading, done]); + useEffect(() => { + if (inputRef.current) { + inputRef.current.focus(); // Ensure the input box retains focus + } + }, [userInput, loading, done]); // Add other dependencies if necessary + return (
@@ -122,6 +129,7 @@ export default function App() { >