Skip to content

Commit

Permalink
handle enter key in cjk input method (#2657)
Browse files Browse the repository at this point in the history
Co-authored-by: zhhanging <[email protected]>
  • Loading branch information
zhhanging and zhhanging committed Apr 9, 2024
1 parent 5fd6025 commit 5a9c63a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion web/screens/Chat/ChatInput/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const ChatInput: React.FC = () => {
}, [currentPrompt])

const onKeyDown = async (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter' && !e.shiftKey) {
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
e.preventDefault()
if (messages[messages.length - 1]?.status !== MessageStatus.Pending)
sendChatMessage(currentPrompt)
Expand Down

0 comments on commit 5a9c63a

Please sign in to comment.