Merge pull request #679 from Dlouxgit/main

fix: handle conflicts between input method engine and enter key in chatbox
This commit is contained in:
Anirban Kar 2024-12-14 14:16:31 +05:30 committed by GitHub
commit 4f02887565
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -425,12 +425,15 @@ export const BaseChat = React.forwardRef<HTMLDivElement, BaseChatProps>(
} }
event.preventDefault(); event.preventDefault();
if (isStreaming) { if (isStreaming) {
handleStop?.(); handleStop?.();
return; return;
} }
// ignore if using input method engine
if (event.nativeEvent.isComposing) {
return
}
handleSendMessage?.(event); handleSendMessage?.(event);
} }
}} }}