From 8429d9b1222608a1da8a030cd08af317e60dabdb Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Mon, 2 Dec 2024 06:44:27 +0900 Subject: [PATCH] [bugfix] Main Page: Message Input Box. Fix 'show_and_disable_enter_key' behavior that was block everything and can't get arrow up and down key that history navigation feature. --- .../message_input_box/MessageInputBox.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src-ui/app/main_page/main_section/message_container/message_input_box/MessageInputBox.jsx b/src-ui/app/main_page/main_section/message_container/message_input_box/MessageInputBox.jsx index 6aa8a4e6..2f1eb8ba 100644 --- a/src-ui/app/main_page/main_section/message_container/message_input_box/MessageInputBox.jsx +++ b/src-ui/app/main_page/main_section/message_container/message_input_box/MessageInputBox.jsx @@ -53,12 +53,6 @@ export const MessageInputBox = () => { }; const onKeyDownFunction = (e) => { - if (currentSendMessageButtonType.data === "show_and_disable_enter_key") return; - - if (e.keyCode === 13 && !e.shiftKey) { - onSubmitFunction(e); - } - if (e.key === "ArrowUp" && e.shiftKey) { e.preventDefault(); @@ -82,6 +76,13 @@ export const MessageInputBox = () => { ); } } + + if (currentSendMessageButtonType.data === "show_and_disable_enter_key") return; + + if (e.keyCode === 13 && !e.shiftKey) { + onSubmitFunction(e); + } + }; return (