mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-12 18:19:11 +08:00
Web app support sending message using numpad enter (#9659)
This commit is contained in:
parent
e8a6e90a61
commit
6827c4038b
@ -96,7 +96,7 @@ const ChatInputArea = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleKeyUp = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
const handleKeyUp = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
if (e.code === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
// prevent send message when using input method enter
|
// prevent send message when using input method enter
|
||||||
if (!e.shiftKey && !isUseInputMethod.current)
|
if (!e.shiftKey && !isUseInputMethod.current)
|
||||||
@ -106,7 +106,7 @@ const ChatInputArea = ({
|
|||||||
|
|
||||||
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
const handleKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
isUseInputMethod.current = e.nativeEvent.isComposing
|
isUseInputMethod.current = e.nativeEvent.isComposing
|
||||||
if (e.code === 'Enter' && !e.shiftKey) {
|
if (e.key === 'Enter' && !e.shiftKey) {
|
||||||
setQuery(query.replace(/\n$/, ''))
|
setQuery(query.replace(/\n$/, ''))
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user