Bug 13724 - Checkbox onBlur event doesn't fire when clicked with mouse
Summary: Checkbox onBlur event doesn't fire when clicked with mouse
Status: RESOLVED DUPLICATE of bug 22261
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 419.x
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2007-05-14 20:01 PDT by Shawn Porter
Modified: 2022-08-30 22:03 PDT (History)
6 users (show)

See Also:


Attachments
simple testcase (482 bytes, text/html)
2007-05-14 20:02 PDT, Shawn Porter
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shawn Porter 2007-05-14 20:01:54 PDT
onBlur event never fires for input type=textbox
Comment 1 Shawn Porter 2007-05-14 20:02:33 PDT
Created attachment 14557 [details]
simple testcase
Comment 2 David Kilzer (:ddkilzer) 2007-05-14 22:14:02 PDT
Hi Shawn, thanks for the bug report!  This issue appears to be fixed in recent WebKit nightly builds.  Could you test to confirm this? http://nightly.webkit.org/

Just download a DMG, mount it, double-click on the gold Safari icon, then try the test.

Comment 3 Shawn Porter 2007-05-15 06:56:43 PDT
I downloaded the latest nightly build and this is not fixed in it.
Comment 4 David Kilzer (:ddkilzer) 2007-05-15 08:02:41 PDT
(In reply to comment #3)
> I downloaded the latest nightly build and this is not fixed in it.

When tabbing through the input elements on the page, onblur events are fired for both the checkbox and the text field.

However, when clicking on the checkbox with the mouse, then clicking elsewhere on the page, neither shipping Safari nor a local debug build of WebKit r21473 fire an onblur event.

Firefox 2.0.0.3 and Opera 9.10 both fire onblur events when clicking a checkbox, then clicking off of it.

Someone needs to test to see what MSIE 6 and/or 7 do.

Confirmed with a local debug build of WebKig r21473 with Safari 2.0.4 (419.3) on Mac OS X 10.4.9 (8P135).  This is NOT a regression from shipping Safari as it has the same behavior.

Shawn, please provide exact steps to reproduce in the future.  Even with reduced test cases, sometimes it's not obvious how to reproduce a bug.  Thanks!

Comment 5 David Kilzer (:ddkilzer) 2007-05-15 08:05:40 PDT
(In reply to comment #4)
> Shawn, please provide exact steps to reproduce in the future.  Even with
> reduced test cases, sometimes it's not obvious how to reproduce a bug.  Thanks!

As I should have done:

* STEPS TO REPRODUCE
1. Load test case.
2. Click on checkbox using mouse to check the box.  (Note that it does not get a focus ring.)
3. Click elsewhere on the page.

* EXPECTED RESULTS
A JavaScript alert() should have fired saying the onblur event fired.

* ACTUAL RESULTS
No JavaScript alert() fired.

* REGRESSION
Shipping Tiger Safari has the same behavior as WebKit.  Both Firefox 2.0.0.3 and Opera 9.10 fire an onblur event in this case.  MSIE 6/7 are as yet untested.

Comment 6 Shawn Porter 2007-05-15 08:48:17 PDT
OnBlur does fire in IE 6 (6.0.2800.1106) for this test case.
Comment 7 Dave Hyatt 2007-05-15 12:09:33 PDT
This is not a bug.  Buttons and checkboxes and radio buttons are not focusable via the mouse on OS X.  The checkbox isn't firing onblur because it never even got focused.
Comment 8 David Kilzer (:ddkilzer) 2007-05-15 22:47:31 PDT
(In reply to comment #7)
> This is not a bug.  Buttons and checkboxes and radio buttons are not focusable
> via the mouse on OS X.  The checkbox isn't firing onblur because it never even
> got focused.

So is Firefox wrong in this case?

Comment 9 Dave Hyatt 2007-05-15 22:50:46 PDT
Nobody is wrong.  Firefox just isn't matching OS X.  They chose to behave like Firefox (and WinIE) on Windows.  This is one of those cases where the bug reporter is assuming the whole world should be like Windows.  And it's not. :)
Comment 10 Josh Peters 2008-03-24 15:15:50 PDT
(In reply to comment #9)
> Nobody is wrong.  Firefox just isn't matching OS X.  They chose to behave like
> Firefox (and WinIE) on Windows.  This is one of those cases where the bug
> reporter is assuming the whole world should be like Windows.  And it's not. :)

I'll confirm that this exists for Safari on Windows.  Can this be fixed there, at least?
Comment 11 Silas Brill 2011-08-16 12:57:55 PDT
I ran into this problem in Chrome on Windows just a few minutes ago.  Bumping.
Comment 12 Ahmad Saleem 2022-08-30 16:59:06 PDT
I am able to reproduce this bug using attached test case and it does not show "checkbox onBlur works" similar to other browser when after checking "checkbox", you focus on "input" field and it is happening Safari Technology Preview 152.

Other browsers (Chrome Canary 107 and Firefox Nightly 106) both show above alert for "checkbox" but Safari does not.

Just wanted to share updated results. Thanks!
Comment 13 Aditya Keerthi 2022-08-30 22:03:24 PDT
Non-text input elements do not gain focus on click, hence, there is no blur event.

*** This bug has been marked as a duplicate of bug 22261 ***