handle enter key in cjk input method (#2657)
Co-authored-by: zhhanging <hang@mindrank.ai>
This commit is contained in:
parent
5fd6025175
commit
5a9c63a776
@ -99,7 +99,7 @@ const ChatInput: React.FC = () => {
|
|||||||
}, [currentPrompt])
|
}, [currentPrompt])
|
||||||
|
|
||||||
const onKeyDown = async (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
const onKeyDown = async (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
if (e.key === 'Enter' && !e.shiftKey) {
|
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
if (messages[messages.length - 1]?.status !== MessageStatus.Pending)
|
if (messages[messages.length - 1]?.status !== MessageStatus.Pending)
|
||||||
sendChatMessage(currentPrompt)
|
sendChatMessage(currentPrompt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user