File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments