jquery/jquery-ui — pull request #854 by UltCombo (2012-11-29 23:47:21+00:00)
Title: Button: Fixed #7665 - Radio button & checkboxes ignore mouseclicks for minor mouse movements

## Changes:

- Removed some duplicated code from the radios' code - let the change handler update the group's display and aria;
- Removed [#6970](http://bugs.jqueryui.com/ticket/6970) fix's code, which was actually caused by the now-fixed [#5518](http://bugs.jqueryui.com/ticket/5518). #6970's code is not only completely unnecessary now, it was also the main cause of [#7665](http://bugs.jqueryui.com/ticket/7665) which this pull request fixes.
- Added a synthetic click to the checkbox/radio inputs when the click event is not fired after a `mousedown`-`mouseup` sequence in the same label button.
- Passes all current unit tests (tested in FF, Chrome, IE9, Opera). Some tests weren't passing on Safari, seems relative to calling `.click()` on a label not triggering the input's change handler in Safari. I've replaced the `.click()` calls by `.simulate( "click" )` and it passes all unit tests now. If this is an issue, we just have to call `that.refresh()` with a timeout of 0ms inside the label's click handler.
- Added unit test for dragged click. Works as expected in all modern browsers but seems to fail in old IE, even though the fix does work in old IE as seen in the fiddle below. Not sure whether this needs fixing or a conditional block.
- As a side effect, the synthetic click also works around [bugzilla ticket #608180](https://bugzilla.mozilla.org/show_bug.cgi?id=608180), toggling the checkboxes every time you click the label button, no matter how fast you constantly click.

#### [*Fiddle preview*](http://jsfiddle.net/KpDsA/15/show/)