Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

Web app support sending message using numpad enter (#9659)

Hash Brown6827c4038b14
diff --git a/web/app/components/base/chat/chat/chat-input-area/index.tsx b/web/app/components/base/chat/chat/chat-input-area/index.tsx
index f1e72d25567..05aaaa6bc25 100644
--- a/web/app/components/base/chat/chat/chat-input-area/index.tsx
+++ b/web/app/components/base/chat/chat/chat-input-area/index.tsx
@@ -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)
@@ -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()
}