Closed Bug 1524863 Opened 7 years ago Closed 7 years ago

Blur event fired when clicking on focused input checkbox

Categories

(Core :: DOM: Events, defect)

67 Branch
Unspecified
macOS
defect
Not set
normal

Tracking

()

RESOLVED INVALID

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:

  1. Click the "Run with JS"
  2. The checkbox should be focused
  3. 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!

Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Events
Ever confirmed: true
Product: Firefox → Core
Whiteboard: [parity-chrome]

Hi Anne, would you please point out which part of the spec defines the behavior? Are we doing right? Thanks!

Flags: needinfo?(annevk)

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.

Flags: needinfo?(annevk)

Thanks Olli and Anne. Closing as invalid as this is working as expected for Mac. Feel free to reopen if I miss something.

Status: NEW → RESOLVED
Closed: 7 years ago
OS: Unspecified → macOS
Resolution: --- → INVALID

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.

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.

Anne, thanks! Filed at https://github.com/whatwg/html/issues/4356.
If I need to describe more details, please let me know, thanks!

You need to log in before you can comment on or make changes to this bug.