Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: could the message textbox get the focus again after the message is sent? #5

Open
fender0ne opened this issue Feb 10, 2019 · 1 comment

Comments

@fender0ne
Copy link

fender0ne commented Feb 10, 2019

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()
})
...
@ivan3123708
Copy link
Owner

ivan3123708 commented Apr 22, 2019

@fenderOne thanks for your suggestion, I'll fix that when I have time 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants