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

We're always open to a little constructive criticism.

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

Postby 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 tenuki
Posts: 2350
Joined: Oct 23, '06
Location: Seattle Area
Contact tenuki:

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

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

Thanks, Tenuki!

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

User avatar brandon
Posts: 1551
Joined: Sep 25, '07
Scrolling: scrolling
Contact brandon:

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

Postby 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 Geekgirl
Posts: 2700
Joined: May 31, '08
Scrolling: scrolling
Location: Portland, OR
Contact Geekgirl:

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

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

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

User avatar ilya
Site Admin
Posts: 538
Joined: May 20, '05
Location: New York, NY
Contact ilya:

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

Postby 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 tenuki
Posts: 2350
Joined: Oct 23, '06
Location: Seattle Area
Contact tenuki:

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

Postby 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 tenuki
Posts: 2350
Joined: Oct 23, '06
Location: Seattle Area
Contact tenuki:

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

Postby 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 Geekgirl
Posts: 2700
Joined: May 31, '08
Scrolling: scrolling
Location: Portland, OR
Contact Geekgirl:

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

Postby 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 Chip
Mod/Admin
Posts: 22818
Joined: Apr 22, '06
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji

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

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

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

User avatar ilya
Site Admin
Posts: 538
Joined: May 20, '05
Location: New York, NY
Contact ilya:

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

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

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

Nope ... :cry:

User avatar Chip
Mod/Admin
Posts: 22818
Joined: Apr 22, '06
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji

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

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

how about now?

User avatar ilya
Site Admin
Posts: 538
Joined: May 20, '05
Location: New York, NY
Contact ilya:

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

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

did for a sec ... and then not.

User avatar Chip
Mod/Admin
Posts: 22818
Joined: Apr 22, '06
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji

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

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

What version of IE?

User avatar tenuki
Posts: 2350
Joined: Oct 23, '06
Location: Seattle Area
Contact tenuki:

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

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

8.0

The problem appears to be remedied.

User avatar Chip
Mod/Admin
Posts: 22818
Joined: Apr 22, '06
Scrolling: scrolling
Location: Back in the TeaCave atop Mt. Fuji


Today's Poll



Community

In total there are 2 users online :: 1 registered, 0 hidden and 1 guest