Bug 13020 - REGRESSION: Returning false from onkeypress event on Input is ignored when key is Tab
Summary: REGRESSION: Returning false from onkeypress event on Input is ignored when ke...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 523.x (Safari 3)
Hardware: Macintosh OS X 10.4
: P1 Normal
Assignee: Nobody
URL: http://enfinitystudios.thaposse.net/
Keywords: InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-03-08 23:06 PST by Elliott Sprehn
Modified: 2008-01-21 04:47 PST (History)
2 users (show)

See Also:


Attachments
Test Case (884 bytes, text/html)
2007-03-08 23:18 PST, Elliott Sprehn
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Elliott Sprehn 2007-03-08 23:06:46 PST
An onkeypress event handler for an input element which returns false to abort the key press will be ignored when the key that was pressed was Tab. The return value of false is obeyed when the key is not the Tab key.

However, If the onkeydown event is used instead the return value of false will be obeyed for Tab.

This new behavior is consistent with IE, however it is inconsistent with Gecko and previous versions of Safari.

Reproducible in latest nightly: (Fri Mar 9 6:30:40 GMT 2007)
Comment 1 Elliott Sprehn 2007-03-08 23:18:45 PST
Created attachment 13554 [details]
Test Case

In this test case pressing tab in both inputs should do nothing as per previous Safari behavior. However in the input where the event handler was attached with onkeypress the return value of false is ignored and the focus jumps off the input to the Back button in the browser.
Comment 2 Elliott Sprehn 2007-03-08 23:20:40 PST
It should also be noted that Gecko allows aborting Tab key presses with onkeypress, but *not* with onkeydown, which is the exact opposite of this bug.
Comment 3 Alexey Proskuryakov 2007-03-09 09:20:36 PST
Confirmed as a regression with r20057.
Comment 4 Mark Rowe (bdash) 2007-03-13 16:22:00 PDT
<rdar://problem/5061024>
Comment 5 Adele Peterson 2007-03-23 14:25:51 PDT
Committed revision 20453.
Comment 6 Alexey Proskuryakov 2008-01-21 04:47:22 PST
We no longer dispatch keypress event for tab, arrow keys etc., so this fix has been effectively undone.