From 16e72b2f670a39f2fb835ad8e085a0030f4aa350 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sun, 2 Jun 2024 22:28:56 -0700 Subject: [PATCH] fix: #2751 --- src/lib/components/chat/MessageInput.svelte | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte index 7c1c87704..81f1ecd10 100644 --- a/src/lib/components/chat/MessageInput.svelte +++ b/src/lib/components/chat/MessageInput.svelte @@ -828,13 +828,19 @@ e.preventDefault(); } - if (e.key === 'Enter' && !e.shiftKey && prompt !== '') { - submitPrompt(prompt, user); - return; - } + const commandOptionButton = [ + ...document.getElementsByClassName('selected-command-option-button') + ]?.at(-1); - if (e.key === 'Enter' && e.shiftKey && prompt !== '') { - return; + if (!commandOptionButton) { + if (e.key === 'Enter' && !e.shiftKey && prompt !== '' && selected) { + submitPrompt(prompt, user); + return; + } + + if (e.key === 'Enter' && e.shiftKey && prompt !== '') { + return; + } } }