Blur event fired when clicking on focused input checkbox
Categories
(Core :: DOM: Events, defect)
Tracking
()
People
(Reporter: cybai, Unassigned)
Details
(Whiteboard: [parity-chrome])
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:67.0) Gecko/20100101 Firefox/67.0
Steps to reproduce:
Check this JSBin https://jsbin.com/cuwoyuyegu/edit?html,js,console,output
Steps to reproduce:
- Click the "Run with JS"
- The checkbox should be focused
- Click the checkbox
Actual results:
Print "Blur" and then "Click". (Safari and Firefox do in this behavior)
Expected results:
Print "Click" only. (Chrome do in this behavior)
Due to clicking on focused element, I'd expect the blur event would not be fired but I'm not sure which part of spec I should refer to. If I'm wrong, please correct me!
Updated•7 years ago
|
Comment 1•7 years ago
|
||
Hi Anne, would you please point out which part of the spec defines the behavior? Are we doing right? Thanks!
Comment 2•7 years ago
|
||
Note, on Mac we try to follow Mac specific focus handling.
https://searchfox.org/mozilla-central/rev/152993fa346c8fd9296e4cd6622234a664f53341/dom/html/HTMLInputElement.cpp#6235-6240
Comment 3•7 years ago
|
||
This isn't really covered in the standard unfortunately (including there not being a call-out to platform-dependent behavior). It makes sense to follow platform conventions, though this does impose some additional challenges on web developers.
Comment 4•7 years ago
|
||
Thanks Olli and Anne. Closing as invalid as this is working as expected for Mac. Feel free to reopen if I miss something.
| Reporter | ||
Comment 5•7 years ago
|
||
Hi Anne, it makes sense to follow platform conventions to me as well but would you think it's better to cover this in the spec?
Btw, I filed this bugzilla while I investigated react-bootstrap-table/react-bootstrap-table2#521.
Comment 6•7 years ago
|
||
Cheng-You, yeah, please file an issue at https://github.com/whatwg/html/issues/new. I'm guessing this should be described as part of the activation behavior of an input type=checkbox (and type=radio?), though probably requires more tests to be sure.
| Reporter | ||
Comment 7•7 years ago
|
||
Anne, thanks! Filed at https://github.com/whatwg/html/issues/4356.
If I need to describe more details, please let me know, thanks!
Description
•