diff --git a/src/lib/components/chat/Messages/ResponseMessage.svelte b/src/lib/components/chat/Messages/ResponseMessage.svelte index 818e53ec0..b1c91edcc 100644 --- a/src/lib/components/chat/Messages/ResponseMessage.svelte +++ b/src/lib/components/chat/Messages/ResponseMessage.svelte @@ -463,6 +463,18 @@ e.target.style.height = ''; e.target.style.height = `${e.target.scrollHeight}px`; }} + on:keydown={(e) => { + if (e.key === 'Escape') { + document.getElementById('close-edit-message-button')?.click(); + } + + const isCmdOrCtrlPressed = e.metaKey || e.ctrlKey; + const isEnterPressed = e.key === 'Enter'; + + if (isCmdOrCtrlPressed && isEnterPressed) { + document.getElementById('save-edit-message-button')?.click(); + } + }} />