From 3172381bad4a2e7e4b4ff43c796e4aa80f511afd Mon Sep 17 00:00:00 2001 From: Yuichi Oneda Date: Fri, 21 Jun 2024 06:59:31 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix(useTextArea):=20Incorrect=20?= =?UTF-8?q?New=20Line=20while=20Composing=20Japanese=20Text=20(#3103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/hooks/Input/useTextarea.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/hooks/Input/useTextarea.ts b/client/src/hooks/Input/useTextarea.ts index c86aee5b1..0e26070f4 100644 --- a/client/src/hooks/Input/useTextarea.ts +++ b/client/src/hooks/Input/useTextarea.ts @@ -182,7 +182,13 @@ export default function useTextarea({ e.preventDefault(); } - if (e.key === 'Enter' && !enterToSend && !isCtrlEnter && textAreaRef.current) { + if ( + e.key === 'Enter' && + !enterToSend && + !isCtrlEnter && + textAreaRef.current && + !isComposing?.current + ) { e.preventDefault(); insertTextAtCursor(textAreaRef.current, '\n'); forceResize(textAreaRef.current);