make enter submit the change

This commit is contained in:
Abi Raja 2024-05-31 18:45:45 -04:00
parent 5f3868f3c9
commit e1265b2b75

View File

@ -124,6 +124,12 @@ const EditPopup: React.FC<EditPopupProps> = ({
value={updateText}
onChange={(e) => setUpdateText(e.target.value)}
placeholder="Tell the AI what to change about this element..."
onKeyDown={(e) => {
if (e.key === "Enter") {
e.preventDefault();
onUpdate(updateText);
}
}}
/>
<div className="flex justify-end mt-2">
<Button onClick={() => onUpdate(updateText)}>Update</Button>