Skip to content

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

Description

@fender0ne

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions