Skip to content

Commit

Permalink
Web app support sending message using numpad enter (langgenius#7414)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong authored and cuiks committed Sep 2, 2024
1 parent 8df279d commit 6150f96
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/app/components/base/chat/chat/chat-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const ChatInput: FC<ChatInputProps> = ({
}

const handleKeyUp = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.code === 'Enter') {
if (e.key === 'Enter') {
e.preventDefault()
// prevent send message when using input method enter
if (!e.shiftKey && !isUseInputMethod.current)
Expand All @@ -100,7 +100,7 @@ const ChatInput: FC<ChatInputProps> = ({

const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
isUseInputMethod.current = e.nativeEvent.isComposing
if (e.code === 'Enter' && !e.shiftKey) {
if (e.key === 'Enter' && !e.shiftKey) {
setQuery(query.replace(/\n$/, ''))
e.preventDefault()
}
Expand Down

0 comments on commit 6150f96

Please sign in to comment.