From bddf2257fe8596ee1b1d516130c752e9919eb4ae Mon Sep 17 00:00:00 2001 From: Takuya Matsuyama Date: Tue, 7 Jun 2022 15:29:04 +0900 Subject: [PATCH] fix(bubble-input): ignore enter key when composing --- src/bubble-input.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bubble-input.jsx b/src/bubble-input.jsx index 9346d2f..a4f7d8a 100644 --- a/src/bubble-input.jsx +++ b/src/bubble-input.jsx @@ -6,7 +6,8 @@ const BubbleInput = ({ onChange, onSubmit, value }) => { const [submitted, setSubmitted] = useState(false) const handleKeyDown = e => { - if (e.key === 'Enter') { + const { isComposing } = e.nativeEvent + if (e.key === 'Enter' && !isComposing) { onSubmit && onSubmit() e.preventDefault() setSubmitted(true)