RESOLVED DUPLICATE of bug 22261 Bug 13724
Checkbox onBlur event doesn't fire when clicked with mouse
https://bugs.webkit.org/show_bug.cgi?id=13724
Summary Checkbox onBlur event doesn't fire when clicked with mouse
Shawn Porter
Reported 2007-05-14 20:01:54 PDT
onBlur event never fires for input type=textbox
Attachments
simple testcase (482 bytes, text/html)
2007-05-14 20:02 PDT, Shawn Porter
no flags
Shawn Porter
Comment 1 2007-05-14 20:02:33 PDT
Created attachment 14557 [details] simple testcase
David Kilzer (:ddkilzer)
Comment 2 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.
Shawn Porter
Comment 3 2007-05-15 06:56:43 PDT
I downloaded the latest nightly build and this is not fixed in it.
David Kilzer (:ddkilzer)
Comment 4 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!
David Kilzer (:ddkilzer)
Comment 5 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.
Shawn Porter
Comment 6 2007-05-15 08:48:17 PDT
OnBlur does fire in IE 6 (6.0.2800.1106) for this test case.
Dave Hyatt
Comment 7 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.
David Kilzer (:ddkilzer)
Comment 8 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?
Dave Hyatt
Comment 9 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. :)
Josh Peters
Comment 10 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?
Silas Brill
Comment 11 2011-08-16 12:57:55 PDT
I ran into this problem in Chrome on Windows just a few minutes ago. Bumping.
Ahmad Saleem
Comment 12 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!
Aditya Keerthi
Comment 13 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 ***
Note You need to log in before you can comment on or make changes to this bug.