Skip to content

Commit f9fc162

Browse files
committed
Resolves #185
1 parent d2e412d commit f9fc162

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

apps/docs/next-env.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3-
import "./.next/dev/types/routes.d.ts";
3+
import "./.next/types/routes.d.ts";
44

55
// NOTE: This file should not be edited
66
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

packages/elements/src/prompt-input.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,15 @@ export const PromptInputTextarea = ({
782782
return;
783783
}
784784
e.preventDefault();
785-
e.currentTarget.form?.requestSubmit();
785+
786+
// Check if the submit button is disabled before submitting
787+
const form = e.currentTarget.form;
788+
const submitButton = form?.querySelector('button[type="submit"]') as HTMLButtonElement | null;
789+
if (submitButton?.disabled) {
790+
return;
791+
}
792+
793+
form?.requestSubmit();
786794
}
787795

788796
// Remove last attachment when Backspace is pressed and textarea is empty

0 commit comments

Comments
 (0)