-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Blur event fired when clicking on focused input checkbox #4356
Comments
On macOS, form controls are not focusable. See https://html.spec.whatwg.org/#focusable-area The last row in the table which says: "[a]ny other element or part of an element, especially to aid with accessibility or to better match platform conventions" does not include form controls on macOS. |
In OS X form controls are not considered focusable elements. Some browsers (Safari, Firefox) adopt this decision: whatwg/html#4356 https://bugzilla.mozilla.org/show_bug.cgi?id=1524863 https://bugs.webkit.org/show_bug.cgi?id=22261 The resulting implementation is broken - you can call `focus()` on a checkbox and it will be focused, but clicking on a checkbox does not focus it. Further, clicking on a focused checkbox blurs it. To overcome these challenges checkboxes and radios are wrapped in a div that can receive focus (and blur) in a consistent manner. Fixes SitePen#1458
Editor: wrap checkbox and radio button shared editors on Mac In OS X form controls are not considered focusable elements. Some browsers (Safari, Firefox) adopt this decision: whatwg/html#4356 https://bugzilla.mozilla.org/show_bug.cgi?id=1524863 https://bugs.webkit.org/show_bug.cgi?id=22261 The resulting implementation is broken - you can call `focus()` on a checkbox and it will be focused, but clicking on a checkbox does not focus it. Further, clicking on a focused checkbox blurs it. To overcome these challenges checkboxes and radios are wrapped in a div that can receive focus (and blur) in a consistent manner. Fixes #1458
Editor: wrap checkbox and radio button shared editors on Mac In OS X form controls are not considered focusable elements. Some browsers (Safari, Firefox) adopt this decision: whatwg/html#4356 https://bugzilla.mozilla.org/show_bug.cgi?id=1524863 https://bugs.webkit.org/show_bug.cgi?id=22261 The resulting implementation is broken - you can call `focus()` on a checkbox and it will be focused, but clicking on a checkbox does not focus it. Further, clicking on a focused checkbox blurs it. To overcome these challenges checkboxes and radios are wrapped in a div that can receive focus (and blur) in a consistent manner. Fixes #1458
In OS X form controls are not considered focusable elements. Some browsers (Safari, Firefox) adopt this decision: whatwg/html#4356 https://bugzilla.mozilla.org/show_bug.cgi?id=1524863 https://bugs.webkit.org/show_bug.cgi?id=22261 The resulting implementation is broken - you can call `focus()` on a checkbox and it will be focused, but clicking on a checkbox does not focus it. Further, clicking on a focused checkbox blurs it. To overcome these challenges checkboxes and radios are wrapped in a div that can receive focus (and blur) in a consistent manner. Fixes #1458
Hello, I seem to be getting different results in the latest version of MacOS. Chrome and Firefox only fire the click event, when clicking the focused checkbox. No blur event is fired after the checkbox has received focused and is clicked. Perhaps something has changed in MacOS? Cheers |
There's a filed bugzilla.
While investigating react-bootstrap-table/react-bootstrap-table2#521, I found a small test case as https://jsbin.com/cuwoyuyegu/edit?html,js,console,output.
How to reproduce:
In
Firefox
andSafari
, it will fireblur
and thenclick
event.In
Chrome
, it will only fireclick
event.According to Olli mentioned in the bugzilla, Firefox just follows the Mac specific focus handling.
So, I'm guessing Webkit handles in the same way.
As @annevk said, currently, there's no spec related to this behavior that we should follow platform convention.
Maybe we should update the spec to describe about this? Or, should we have define a specific behavior for it?
The text was updated successfully, but these errors were encountered: