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> = ({
3535 setInternalInputValue ( "" ) ;
3636 } ;
3737
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 ) ) {
4241 e . preventDefault ( ) ;
4342 handleInternalSubmit ( ) ;
4443 }
@@ -59,9 +58,9 @@ export const InputForm: React.FC<InputFormProps> = ({
5958 < Textarea
6059 value = { internalInputValue }
6160 onChange = { ( e ) => setInternalInputValue ( e . target . value ) }
62- onKeyDown = { handleInternalKeyDown }
61+ onKeyDown = { handleKeyDown }
6362 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
6564 md:text-base min-h-[56px] max-h-[200px]` }
6665 rows = { 1 }
6766 />
You can’t perform that action at this time.
0 commit comments