feat: save Chatflow title when the ENTER key is pressed or discard upon ESC is pressed (#3265)

This simple event handler improves the usability of the UI by avoiding having to use the mouse to save or dicard title changes
This commit is contained in:
Humberto Rodríguez A.
2024-09-26 16:25:47 +02:00
committed by GitHub
parent eafa06015a
commit b8b34832b4
@@ -310,6 +310,13 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, handleSaveFlow, handleDeleteFlo
ml: 2
}}
defaultValue={flowName}
onKeyDown={(e) => {
if (e.key === 'Enter') {
submitFlowName()
} else if (e.key === 'Escape') {
setEditingFlowName(false)
}
}}
/>
<ButtonBase title='Save Name' sx={{ borderRadius: '50%' }}>
<Avatar