From 12206f05573bc76dccb2868064959cb4bc2c3556 Mon Sep 17 00:00:00 2001 From: mic Date: Thu, 12 Feb 2026 22:46:50 +0100 Subject: [PATCH] submit additional_text when pressing enter. see #525 fixes #654 --- api_webchat/messageInput.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/api_webchat/messageInput.js b/api_webchat/messageInput.js index 3ebdd8c7..aebc2584 100644 --- a/api_webchat/messageInput.js +++ b/api_webchat/messageInput.js @@ -238,7 +238,12 @@ class MessageInput extends HTMLElement { this._customBtn = shadowRoot.querySelector('#mzta-custom_btn'); this._customStep = shadowRoot.querySelector('#mzta-custom_step'); this._customBtn.addEventListener("click", () => { this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) }); - this._customTextArea.addEventListener("keydown", (event) => { if(event.code == "Enter" && event.ctrlKey) this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}) }); + this._customTextArea.addEventListener("keydown", (event) => { + if (event.key === "Enter" && !event.shiftKey) { + event.preventDefault(); + this._customTextBtnClick({customBtn:this._customBtn,customLoading:this._customLoading,customDiv:this._customText}); + } + }); } connectedCallback() {