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

Cannot remove typing text #3291

Closed
beratetik opened this issue Jul 9, 2018 · 2 comments
Closed

Cannot remove typing text #3291

beratetik opened this issue Jul 9, 2018 · 2 comments

Comments

@beratetik
Copy link

getTypingMessages(data).fadeOut(() => {

getTypingMessages function doesn't return typing elements. So it should be fixed like this:

getTypingMessages(data).prevObject.fadeOut(() => {
  $(this).remove();
});
@Dian8
Copy link

Dian8 commented Aug 27, 2018

I've explored this issue too and found the following code works:

  // Gets the 'X is typing' messages of a user
  const getTypingMessages = (data) => {
    return $('.message.typing').filter(function(i) {
      return $(this).data('username') === data.username;
    });
  }

Does anybody know why '=>' syntax does not work here?

@darrachequesne
Copy link
Member

@Dian8 it's because the scope of this is different when using () => {} or function(){}

@beratetik it should be fixed by 7e35f90

dzad pushed a commit to dzad/socket.io that referenced this issue May 29, 2023
`user is typing` messages were not properly removed

Closes socketio#3291
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

3 participants