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'}
|
||||
value={currMsg}
|
||||
tabIndex={0}
|
||||
onKeyDown={() => {
|
||||
this.resizeInputBar()
|
||||
}}
|
||||
onKeyUp={(e) => {
|
||||
onKeyDown={(e) => {
|
||||
const lastMessage = msgs[selectedUser]
|
||||
? msgs[selectedUser].lastMessage
|
||||
: null
|
||||
|
@ -443,7 +440,7 @@ export default class Chat extends React.Component {
|
|||
) {
|
||||
this.chatMessageSeen(selectedUser)
|
||||
}
|
||||
if (e.key === 'Enter' || e.keyCode === 13) {
|
||||
if (e.key === 'Enter') {
|
||||
if (!e.shiftKey) this.sendMsg(currMsg)
|
||||
}
|
||||
this.resizeInputBar()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue