advanced-chat icon indicating copy to clipboard operation
advanced-chat copied to clipboard

Spaces in people-names breaks "is-typing" functionality.

Open ghost opened this issue 10 years ago • 1 comments

Just FYI, the selector breaks when a person has a name like "Some Bro", anything with a space. I didn't clone your repo or anything so I'm just posting the issue + fix here. In clien.js

socket.on("isTyping", function(data) { if (data.isTyping) { if ($("#"+data.person.split(' ').join('-')+"").length === 0) { $("#updates").append("<li id='"+ data.person.split(' ').join('-') +"'> " + data.person + " is typing."); ......MY CUSTOM CALLBACK, OMITTED } } else { $("#"+data.person.split(' ').join('-')+"").remove(); } });

As you can see it's a simple matter of splitting where any spaces are and joining by a non space char. Cool app, much thanks for sharing it. :)

ghost avatar Nov 08 '14 11:11 ghost

Thanks Jesse - you can of course do a pull request and submit this fix :)

I’m swamped with all sorts of other work so I may struggle to update this

Thank you,

  • Tamas

http://me.tamas.io/

On 8 Nov 2014, at 11:01, Jesse Nicholson [email protected] wrote:

Just FYI, the selector breaks when a person has a name like "Some Bro", anything with a space. I didn't clone your repo or anything so I'm just posting the issue + fix here. In clien.js

socket.on("isTyping", function(data) { if (data.isTyping) { if ($("#"+data.person.split(' ').join('-')+"").length === 0) { $("#updates").append("

" + data.person + " is typing."); ......MY CUSTOM CALLBACK, OMITTED } } else { $("#"+data.person.split(' ').join('-')+"").remove(); } }); As you can see it's a simple matter of splitting where any spaces are and joining by a non space char. Cool app, much thanks for sharing it. :)

— Reply to this email directly or view it on GitHub https://github.com/tamaspiros/advanced-chat/issues/11.

tpiros avatar Nov 08 '14 14:11 tpiros