File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -35,10 +35,9 @@ export const InputForm: React.FC<InputFormProps> = ({
35
35
setInternalInputValue ( "" ) ;
36
36
} ;
37
37
38
- const handleInternalKeyDown = (
39
- e : React . KeyboardEvent < HTMLTextAreaElement >
40
- ) => {
41
- if ( e . key === "Enter" && ! e . shiftKey ) {
38
+ const handleKeyDown = ( e : React . KeyboardEvent < HTMLTextAreaElement > ) => {
39
+ // Submit with Ctrl+Enter (Windows/Linux) or Cmd+Enter (Mac)
40
+ if ( e . key === "Enter" && ( e . ctrlKey || e . metaKey ) ) {
42
41
e . preventDefault ( ) ;
43
42
handleInternalSubmit ( ) ;
44
43
}
@@ -59,9 +58,9 @@ export const InputForm: React.FC<InputFormProps> = ({
59
58
< Textarea
60
59
value = { internalInputValue }
61
60
onChange = { ( e ) => setInternalInputValue ( e . target . value ) }
62
- onKeyDown = { handleInternalKeyDown }
61
+ onKeyDown = { handleKeyDown }
63
62
placeholder = "Who won the Euro 2024 and scored the most goals?"
64
- className = { `w-full text-neutral-100 placeholder-neutral-500 resize-none border-0 focus:outline-none focus:ring-0 outline-none focus-visible:ring-0 shadow-none
63
+ className = { `w-full text-neutral-100 placeholder-neutral-500 resize-none border-0 focus:outline-none focus:ring-0 outline-none focus-visible:ring-0 shadow-none
65
64
md:text-base min-h-[56px] max-h-[200px]` }
66
65
rows = { 1 }
67
66
/>
You can’t perform that action at this time.
0 commit comments