diff --git a/src/lib/components/chat/MessageInput.svelte b/src/lib/components/chat/MessageInput.svelte
index bb941c90e..d2fe8ca29 100644
--- a/src/lib/components/chat/MessageInput.svelte
+++ b/src/lib/components/chat/MessageInput.svelte
@@ -298,6 +298,24 @@
submitPrompt(prompt);
}
}}
+ on:keydown={(e) => {
+ if (prompt === '' && e.key == 'ArrowUp') {
+ e.preventDefault();
+
+ const userMessageElement = [
+ ...document.getElementsByClassName('user-message')
+ ]?.at(-1);
+
+ const editButton = [
+ ...document.getElementsByClassName('edit-user-message-button')
+ ]?.at(-1);
+
+ console.log(userMessageElement);
+
+ userMessageElement.scrollIntoView({ block: 'center' });
+ editButton?.click();
+ }
+ }}
rows="1"
on:input={(e) => {
e.target.style.height = '';
diff --git a/src/lib/components/chat/Messages/UserMessage.svelte b/src/lib/components/chat/Messages/UserMessage.svelte
index a760ce3a8..693d20e23 100644
--- a/src/lib/components/chat/Messages/UserMessage.svelte
+++ b/src/lib/components/chat/Messages/UserMessage.svelte
@@ -24,6 +24,8 @@
editElement.style.height = '';
editElement.style.height = `${editElement.scrollHeight}px`;
+
+ editElement?.focus();
};
const editMessageConfirmHandler = async () => {
@@ -43,7 +45,9 @@