diff --git a/features/edit/edit-forms/params/list-param.tsx b/features/edit/edit-forms/params/list-param.tsx index e9bd31b7..5689f7e4 100644 --- a/features/edit/edit-forms/params/list-param.tsx +++ b/features/edit/edit-forms/params/list-param.tsx @@ -1,6 +1,5 @@ 'use client'; -import * as React from 'react'; import { FC, useState } from 'react'; import { useFieldArray, useFormContext } from 'react-hook-form'; import MaterialSymbolsAddRounded from '~icons/material-symbols/add-rounded'; @@ -56,12 +55,25 @@ const ListParam: FC = ({ param, mode }) => { value={newItem} onChange={(e) => setNewItem(e.target.value)} className="flex-1" + onKeyDown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + if ( + newItem && + newItem.length !== 0 && + newItem.trim() !== '' + ) { + append({ value: newItem }); + setNewItem(''); + } + } + }} />