diff --git a/web/pages/Chat/components/InputBar.tsx b/web/pages/Chat/components/InputBar.tsx index 2aea27c46..9c72f6d96 100644 --- a/web/pages/Chat/components/InputBar.tsx +++ b/web/pages/Chat/components/InputBar.tsx @@ -280,6 +280,22 @@ const InputBar: Component<{ ev.preventDefault() } }} + onKeyUp={(ev) => { + if (ev.key === 'ArrowUp') { + const editBtn = document.querySelector( + '[data-last="true"] .edit-btn' + ) as HTMLDivElement | null + if (!editBtn) return + + editBtn.click() + const msgBox = document.querySelector( + '[data-last="true"] .msg-edit-text-box' + ) as HTMLDivElement | null + if (!msgBox) return + + msgBox.focus() + } + }} onInput={updateText} />