onBlur event never fires for input type=textbox
Created attachment 14557 [details] simple testcase
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.
I downloaded the latest nightly build and this is not fixed in it.
(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!
(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.
OnBlur does fire in IE 6 (6.0.2800.1106) for this test case.
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.
(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?
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. :)
(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?
I ran into this problem in Chrome on Windows just a few minutes ago. Bumping.
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!
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 ***