Skip to content

Commit

Permalink
Web app support sending message using numpad enter (langgenius#9659)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong authored and JunXu01 committed Nov 9, 2024
1 parent 5998f9e commit d0a152f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/app/components/base/chat/chat/chat-input-area/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const ChatInputArea = ({
}

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 @@ -106,7 +106,7 @@ const ChatInputArea = ({

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 d0a152f

Please sign in to comment.