mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-28 09:56:23 +02:00
Fix compose box chat clearing issue
This commit is contained in:
parent
053c1df3f3
commit
2e9a81dfba
1 changed files with 11 additions and 3 deletions
|
|
@ -36,8 +36,13 @@ export function ComposeBox({
|
|||
if (!prompt) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear input before calling handleUserMessage
|
||||
setInput('');
|
||||
|
||||
if (inputRef.current) {
|
||||
inputRef.current.value = '';
|
||||
}
|
||||
|
||||
handleUserMessage(prompt);
|
||||
}
|
||||
|
||||
|
|
@ -49,8 +54,11 @@ export function ComposeBox({
|
|||
}
|
||||
// focus on the input field
|
||||
useEffect(() => {
|
||||
inputRef.current?.focus();
|
||||
}, [messages]);
|
||||
if (inputRef.current) {
|
||||
inputRef.current.focus();
|
||||
inputRef.current.value = input; // Ensure sync with state
|
||||
}
|
||||
}, [messages, input]);
|
||||
|
||||
return (
|
||||
<div className="relative group">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue