diff --git a/client/src/components/Prompts/Groups/VariableForm.tsx b/client/src/components/Prompts/Groups/VariableForm.tsx index 510b201f89..d77d164f72 100644 --- a/client/src/components/Prompts/Groups/VariableForm.tsx +++ b/client/src/components/Prompts/Groups/VariableForm.tsx @@ -3,7 +3,7 @@ import { useForm, useFieldArray, Controller, useWatch } from 'react-hook-form'; import type { TPromptGroup } from 'librechat-data-provider'; import { extractVariableInfo, wrapVariable, replaceSpecialVars } from '~/utils'; import { useAuthContext, useLocalize, useSubmitMessage } from '~/hooks'; -import { Input } from '~/components/ui'; +import { Textarea } from '~/components/ui'; type FormValues = { fields: { variable: string; value: string }[]; @@ -103,11 +103,18 @@ export default function VariableForm({ name={`fields.${index}.value`} control={control} render={({ field }) => ( - { + // Submit the form on enter like you would with an Input component + if (e.key === 'Enter' && !e.shiftKey) { + e.preventDefault(); + handleSubmit((data) => onSubmit(data))(); + } + }} /> )} /> diff --git a/client/src/components/Prompts/PromptEditor.tsx b/client/src/components/Prompts/PromptEditor.tsx index 034efb7c97..4848746143 100644 --- a/client/src/components/Prompts/PromptEditor.tsx +++ b/client/src/components/Prompts/PromptEditor.tsx @@ -70,7 +70,7 @@ const PromptEditor: React.FC = ({ name, isEditing, setIsEditing }) => { onBlur={() => setIsEditing(false)} /> ) : ( - {field.value} +
{field.value}
) } />