fix: submit question on return key
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite + React + TS</title>
|
||||
<title>Kwisatz Haderach - Dune Expert</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
@@ -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