Fix for: Chat is broken for Safari/Chrome/webkit

We're always open to a little constructive criticism.


User avatar
Aug 24th, '10, 16:13
Posts: 2299
Joined: Oct 23rd, '06, 19:46
Location: Seattle Area
Contact: tenuki

Fix for: Chat is broken for Safari/Chrome/webkit

by tenuki » Aug 24th, '10, 16:13

Problem: Webkit browsers fire their events too soon - so things like 'onkeyup' intermittently break because the event keycode hasn't been set yet depending on what else the computer is doing.

Symptom: You can see this in the chat window when people with those browsers type and it thinks they have pressed 'enter', so it posts the chat frequently when they haven't actually hit 'enter' resulting in fragmented and often single character posts. It's really really annoying. Webkit browsers constitute around 20% of the browsers on the internet and Chrome in particular is growing faster than anyone. So your chat script is annoying 20% of your user base.

Possible Solution:

Currently the chat text input html element has the property shown below

Code: Select all

onkeyup="if(window.event.keyCode == 13)){sendComment();}"
This is what is breaking on webkit browsers - to ensure the event get's called _after_ the page is updated and the event keycode is set you wrap it in a timeout set to zero.

replace above with:

Code: Select all

onkeyup="setTimeout(if(window.event.keyCode == 13)){sendComment();},0);"
and everything works properly for webkit browsers. (tested on chrome for a while by editing the html in the browser and didn't see the problem once after the edit went in) Your mileage may vary, but it seems like a relatively simple fix with a large positive impact.


Thanks!

User avatar
Aug 24th, '10, 16:19
Posts: 1487
Joined: Sep 25th, '07, 19:51
Scrolling: scrolling
Been thanked: 1 time
Contact: brandon

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by brandon » Aug 24th, '10, 16:19

Thanks, Tenuki!

This fixes it for me, hope it makes it into the site.

User avatar
Aug 24th, '10, 17:29
Posts: 2625
Joined: May 31st, '08, 02:44
Scrolling: scrolling
Location: Portland, OR
Contact: Geekgirl

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Geekgirl » Aug 24th, '10, 17:29

it's annoying way more than 20% of the users... it's a PITA for both us "alt-browser" users, AND for everyone who has to try to read it.

I don't really understand the content of your post, is this something we can do ourselves in the browser window before using chat? or is this a fix that can only be applied at the adagio end? (sorry for the n00b question)

User avatar
Aug 24th, '10, 17:30
Adagio
Posts: 475
Joined: May 20th, '05, 16:14
Location: New York, NY
Contact: ilya

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by ilya » Aug 24th, '10, 17:30

I've updated the code. Please let me know if the IM is better behaved.

User avatar
Aug 24th, '10, 17:34
Posts: 2299
Joined: Oct 23rd, '06, 19:46
Location: Seattle Area
Contact: tenuki

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by tenuki » Aug 24th, '10, 17:34

Geekgirl wrote:it's annoying way more than 20% of the users... it's a PITA for both us "alt-browser" users, AND for everyone who has to try to read it.

I don't really understand the content of your post, is this something we can do ourselves in the browser window before using chat? or is this a fix that can only be applied at the adagio end? (sorry for the n00b question)
both. :) if you select the text box element in chrome and choose 'inspect element' from the contextual menu you can make the change to your browsers html and it will work - but next time you reload/refresh the page it will be back to the old stuff.

long term fix is to fix it at teachat's end - which it appears Ilya has already done. :D

User avatar
Aug 24th, '10, 17:36
Posts: 2299
Joined: Oct 23rd, '06, 19:46
Location: Seattle Area
Contact: tenuki

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by tenuki » Aug 24th, '10, 17:36

ilya wrote:I've updated the code. Please let me know if the IM is better behaved.
yeah!

User avatar
Aug 24th, '10, 17:52
Posts: 2625
Joined: May 31st, '08, 02:44
Scrolling: scrolling
Location: Portland, OR
Contact: Geekgirl

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Geekgirl » Aug 24th, '10, 17:52

tenuki wrote: both. :) if you select the text box element in chrome and choose 'inspect element' from the contextual menu ...
thanks! I have one more forum where this is broken. I'll be able to use it there.

User avatar
Aug 25th, '10, 09:26
Posts: 20891
Joined: Apr 22nd, '06, 20:52
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji
Been thanked: 2 times

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Chip » Aug 25th, '10, 09:26

OK, it seems perhaps this fix is wreaking havoc for IE.

Several things are not working coincidently after the fix. Pressing enter to enter an IM post does not work.

Also after clicking post, one must now left click on the box in order to begin typing the next entry ...

Also, I get this effect a lot ...

a
h
c
n
e
s

Thus having to refresh quite frequently (which also causes loss of work if posting a reply on the forum ... and forget to save).

A real pain!!!!!!!!!! :evil:

So, has the fix broken the IM for IE users??? Seems so.

User avatar
Aug 25th, '10, 14:26
Adagio
Posts: 475
Joined: May 20th, '05, 16:14
Location: New York, NY
Contact: ilya

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by ilya » Aug 25th, '10, 14:26

Please let me know if the new IE bug has been resolved.

User avatar
Aug 25th, '10, 14:57
Posts: 20891
Joined: Apr 22nd, '06, 20:52
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji
Been thanked: 2 times

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Chip » Aug 25th, '10, 14:57

ilya wrote:Please let me know if the new IE bug has been resolved.
Nope ... :cry:

User avatar
Aug 25th, '10, 22:04
Adagio
Posts: 475
Joined: May 20th, '05, 16:14
Location: New York, NY
Contact: ilya

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by ilya » Aug 25th, '10, 22:04

how about now?

User avatar
Aug 25th, '10, 22:12
Posts: 20891
Joined: Apr 22nd, '06, 20:52
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji
Been thanked: 2 times

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Chip » Aug 25th, '10, 22:12

did for a sec ... and then not.

User avatar
Aug 26th, '10, 00:57
Posts: 2299
Joined: Oct 23rd, '06, 19:46
Location: Seattle Area
Contact: tenuki

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by tenuki » Aug 26th, '10, 00:57

What version of IE?

User avatar
Aug 26th, '10, 01:48
Posts: 20891
Joined: Apr 22nd, '06, 20:52
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji
Been thanked: 2 times

Re: Fix for: Chat is broken for Safari/Chrome/webkit

by Chip » Aug 26th, '10, 01:48

8.0

The problem appears to be remedied.

+ Post Reply