Skip to content

Commit

Permalink
chore: support sending message using numpad enter
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzuodong committed Oct 22, 2024
1 parent a97e909 commit 84a53cb
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 84a53cb

Please sign in to comment.