chat-app
chat-app copied to clipboard
Improvement: could the message textbox get the focus again after the message is sent?
Improvement: could the message textbox regain the focus after the message is sent (in case the send btn is clicked)?
You could use something like the following:
let messageTextbox = jQuery('[name=message]')
...
socket.emit('createMessage', DATA, function(err, server_msg) { // Ack.
if (!err) {
messageTextbox.val('') // Clear the message input text
}
messageTextbox.focus()
})
...
@fenderOne thanks for your suggestion, I'll fix that when I have time :wink: