Jeremy Kitchen
2006-Jan-27 03:54 UTC
[prototype] [BUG] Event.stop doesn''t stop all keystrokes on some browsers
attached is an html file I used to test the bug. the top text box should not allow you to type anything, not tab, not enter, nothing. bottom text box should work fine. requires prototype.js and includes jslog for jslog.info although it only occurs in one place, I just wanted to make sure the event was firing without having to use alerts :) tested browsers/platforms: opera: mac / win / lin: does not prevent input whatsoever, including tab and enter. safari 2.02 mac: does not prevent the ''enter'' key from getting through ie6/win: firefox win/linux/mac: camino mac: mozilla win/linux: konq linux: works as expected (no input is allowed) One of our employees reported this bug when we implemented an Autocompleter.Local element into a page. We initially told users they could hit up/down and enter to complete the address and they ended up submitting the form! We''ve since told them to use tab, and none of our users that I''m aware of use opera :) I''m not sure if this should be filed here, on the rails bug tracker, or even to go as far as posting on the browser bug report systems, so please let me know if this is the wrong place. Thanks for prototype.js, script.aculo.us and everything else, it makes my life MUCH easier :) Here''s to a strong and bug-free future :) -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
Jeremy Kitchen
2006-Jan-27 04:32 UTC
Re: [prototype] [BUG] Event.stop doesn''t stop all keystrokes on some browsers
On Thursday 26 January 2006 19:54, Jeremy Kitchen wrote:> attached is an html file I used to test the bug. the top text box should > not allow you to type anything, not tab, not enter, nothing. bottom text > box should work fine.a little more digging into this and it appears it''s that different browsers handle the keypress at different times (from what I can see, there are 3 events triggered when you press a key, keydown, keypress, and keyup). I changed line 1531 to ''keypress'' from keydown and on all of the browsers I tested (safari, opera, konqueror) it appeared to work fine, with the exception of opera, which still allowed the tab key through. Just curious, is there a reason the browser is detected on the preceding lines and changes the event to keydown? It appears to work fine as keypress on the affected browsers. (even the enter/return key is stopped on safari) I''ll continue to look into why tab still gets through on opera, and inform of my progress :) -Jeremy -- Jeremy Kitchen ++ kitchen-RA8HwDor7flnDGu+y90WmgC/G2K4zDHf@public.gmane.org In the beginning was The Word and The Word was Content-type: text/plain -- The Word of Bob. _______________________________________________ Rails-spinoffs mailing list Rails-spinoffs-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs