File tree Expand file tree Collapse file tree
packages/workshop-frontend/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1835,6 +1835,7 @@ export const ChatInput = ({
18351835} ) => {
18361836 const toasts = useKumoToastManager ( ) ;
18371837 const [ inputValue , setInputValue ] = useState ( "" ) ;
1838+ const [ isComposing , setIsComposing ] = useState ( false ) ;
18381839 const [ capsules , setCapsules ] = useState < InputCapsule [ ] > ( [ ] ) ;
18391840 const [ pendingAttachments , setPendingAttachments ] = useState < PendingAttachment [ ] > ( [ ] ) ;
18401841 const [ isSending , setIsSending ] = useState ( false ) ;
@@ -3099,6 +3100,8 @@ export const ChatInput = ({
30993100 onSelect = { handleCursorChange }
31003101 onClick = { handleCursorChange }
31013102 onKeyUp = { handleCursorChange }
3103+ onCompositionStart = { ( ) => setIsComposing ( true ) }
3104+ onCompositionEnd = { ( ) => setIsComposing ( false ) }
31023105
31033106 onMouseDown = { ( e ) => {
31043107 if ( e . button !== 0 ) return ;
@@ -3199,8 +3202,8 @@ export const ChatInput = ({
31993202 return ;
32003203 }
32013204 }
3202- // Enter sends message ( unless Shift is held)
3203- if ( e . key === "Enter" && ! e . shiftKey ) {
3205+ // Enter sends message unless Shift is held or IME is composing
3206+ if ( e . key === "Enter" && ! e . shiftKey && ! isComposing && ! e . nativeEvent ?. isComposing ) {
32043207 e . preventDefault ( ) ;
32053208 if ( ! isAgentActive && ! isBlocked ) submitMessage ( ) ;
32063209 return ;
You can’t perform that action at this time.
0 commit comments