Merge pull request #4268 from cuhong/fix/cjk-input-issue
Fix: Fix issue with duplicate events on Enter key press during CJK character composition in chat input
This commit is contained in:
commit
c166f7c636
@ -225,7 +225,11 @@ const RichTextEditor = ({
|
||||
|
||||
const handleKeyDown = useCallback(
|
||||
(event: React.KeyboardEvent) => {
|
||||
if (event.key === 'Enter' && !event.shiftKey) {
|
||||
if (
|
||||
event.key === 'Enter' &&
|
||||
!event.shiftKey &&
|
||||
event.nativeEvent.isComposing === false
|
||||
) {
|
||||
event.preventDefault()
|
||||
if (messages[messages.length - 1]?.status !== MessageStatus.Pending) {
|
||||
sendChatMessage(currentPrompt)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user