Przeglądaj źródła

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

tags/0.10.1
Hash Brown 1 rok temu
rodzic
commit
6827c4038b
No account linked to committer's email address

+ 2
- 2
web/app/components/base/chat/chat/chat-input-area/index.tsx Wyświetl plik

@@ -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()
}

Ładowanie…
Anuluj
Zapisz