Fix unintended input submission during IME composition (#1552)

Prevent input submission on Enter key press during IME composition
This commit is contained in:
Daiki Sakai 2024-03-22 20:49:17 +09:00 committed by GitHub
commit 402e706f27
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -29,7 +29,7 @@ export default function ChatInput({
<div className="relative">
<Textarea
onKeyDown={(event) => {
if (event.key === "Enter" && !lockChat && !event.shiftKey) {
if (event.key === "Enter" && !event.nativeEvent.isComposing && !lockChat && !event.shiftKey) {
sendMessage();
}
}}