Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7804 closed bug (duplicate)

Button Widget state gets out of sync when used with a checkbox

Reported by: jamesc Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.button Version: 1.8.16
Keywords: Cc:
Blocked by: Blocking:

Description

As per the example in:

http://jsbin.com/uzikat/16/edit

Clicking more than once in quick succession will demonstrate the issue.

Issue appears to only exist in firefox, tested on FF7, IE and Chrome.

When double-clicking, or performing other rapid clicks, the visual state can get out of sync with the checkbox state. This looks to be because of a stray toggleClass. Made an attempted fix, don't have git/etc set up here, patch against stock 1.8.16 is below:

--- jquery.ui.button.js 2011-08-18 18:39:36.000000000 +0100
+++ jquery.ui.button.patched..js        2011-10-20 16:54:57.356507200 +0100
@@ -144,7 +144,6 @@
                                if ( options.disabled || clickDragged ) {
                                        return false;
                                }
-                               $( this ).toggleClass( "ui-state-active" );
                                self.buttonElement.attr( "aria-pressed", self.element[0].checked );
                        });
                } else if ( this.type === "radio" ) {

Change History (2)

comment:1 Changed 8 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:2 Changed 8 years ago by Scott González

Duplicate of #5518.

Note: See TracTickets for help on using tickets.