Button toggling checkbox is always left un-checked on spacebar "click"
Created by: bggardner
- Operating system and version: Ubuntu 18.10
- Browser and version: Chrome 70.0.3538.77 and Firefox 63.0
- Example: https://jsbin.com/gaxuwobiku/edit?html,output
Problem: When I'm filling out forms using a physical keyboard, I typically tab from input to input, and use the spacebar for checking/unchecking checkboxes. Unfortunately, using the example code for a label button with "embedded" checkbox does not work when the spacebar initiates the "click". A mouse click works as expected. It appears to do something with the timing of the event, as the "checked" property is properly set immediately after the event, but is always removed (read as false) sometime after.