mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
chat: moved event handling from keyup to keydown
This commit is contained in:
parent
126812647a
commit
1e5f8930ab
1 changed files with 2 additions and 5 deletions
|
@ -429,10 +429,7 @@ export default class Chat extends React.Component {
|
||||||
type={'text'}
|
type={'text'}
|
||||||
value={currMsg}
|
value={currMsg}
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
onKeyDown={() => {
|
onKeyDown={(e) => {
|
||||||
this.resizeInputBar()
|
|
||||||
}}
|
|
||||||
onKeyUp={(e) => {
|
|
||||||
const lastMessage = msgs[selectedUser]
|
const lastMessage = msgs[selectedUser]
|
||||||
? msgs[selectedUser].lastMessage
|
? msgs[selectedUser].lastMessage
|
||||||
: null
|
: null
|
||||||
|
@ -443,7 +440,7 @@ export default class Chat extends React.Component {
|
||||||
) {
|
) {
|
||||||
this.chatMessageSeen(selectedUser)
|
this.chatMessageSeen(selectedUser)
|
||||||
}
|
}
|
||||||
if (e.key === 'Enter' || e.keyCode === 13) {
|
if (e.key === 'Enter') {
|
||||||
if (!e.shiftKey) this.sendMsg(currMsg)
|
if (!e.shiftKey) this.sendMsg(currMsg)
|
||||||
}
|
}
|
||||||
this.resizeInputBar()
|
this.resizeInputBar()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue