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
This commit is contained in:
Humberto Rodríguez A. 2024-09-26 16:25:21 +02:00 committed by GitHub
parent 9f6fcb9cf6
commit eafa06015a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -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)
}}
/>
</DialogContent>
<DialogActions>