From eafa06015a4b29f6668b7dcd1a2597fc24bc6576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Humberto=20Rodr=C3=ADguez=20A=2E?= Date: Thu, 26 Sep 2024 16:25:21 +0200 Subject: [PATCH] feat: save a new Chatflow when the `ENTER` key is pressed (#3261) This simple event handler improve the usability of the UI by avoiding having to use the mouse or having to tab twice and then hit enter to save a flow --- packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx b/packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx index 1f6fa82ec..e56713289 100644 --- a/packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx +++ b/packages/ui/src/ui-component/dialog/SaveChatflowDialog.jsx @@ -40,6 +40,9 @@ const SaveChatflowDialog = ({ show, dialogProps, onCancel, onConfirm }) => { placeholder='My New Chatflow' value={chatflowName} onChange={(e) => setChatflowName(e.target.value)} + onKeyDown={(e) => { + if (isReadyToSave && e.key === 'Enter') onConfirm(e.target.value) + }} />