fix: submit question on return key
This commit is contained in:
@@ -164,7 +164,13 @@ function RouteComponent() {
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
<div className="flex gap-3 flex-shrink-0">
|
||||
<form
|
||||
className="flex gap-3 flex-shrink-0"
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
handleSendQuestion();
|
||||
}}
|
||||
>
|
||||
<Input
|
||||
className="flex-1"
|
||||
placeholder="Start typing..."
|
||||
@@ -172,14 +178,14 @@ function RouteComponent() {
|
||||
onChange={(e) => setInputValue(e.target.value)}
|
||||
disabled={isBusy}
|
||||
/>
|
||||
<Button size="icon" disabled={isBusy} onClick={handleSendQuestion}>
|
||||
<Button size="icon" disabled={isBusy} type="submit">
|
||||
{isBusy ? (
|
||||
<LoaderCircleIcon className="animate-spin" />
|
||||
) : (
|
||||
<SendHorizontalIcon />
|
||||
)}
|
||||
</Button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user