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:
parent
eafa06015a
commit
b8b34832b4
|
|
@ -310,6 +310,13 @@ const CanvasHeader = ({ chatflow, isAgentCanvas, handleSaveFlow, handleDeleteFlo
|
||||||
ml: 2
|
ml: 2
|
||||||
}}
|
}}
|
||||||
defaultValue={flowName}
|
defaultValue={flowName}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
submitFlowName()
|
||||||
|
} else if (e.key === 'Escape') {
|
||||||
|
setEditingFlowName(false)
|
||||||
|
}
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<ButtonBase title='Save Name' sx={{ borderRadius: '50%' }}>
|
<ButtonBase title='Save Name' sx={{ borderRadius: '50%' }}>
|
||||||
<Avatar
|
<Avatar
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue