Skip to content

Commit af5b5b1

Browse files
committed
Merge pull request jquery#207 from eikes/bug-5945
Button: stop disabled button from firing click events. fixes #5945.
2 parents 993d37a + a7f1659 commit af5b5b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ui/jquery.ui.button.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ $.widget( "ui.button", {
103103
})
104104
.bind( "blur.button", function() {
105105
$( this ).removeClass( focusClass );
106+
})
107+
.bind( "click.button", function( event ) {
108+
if ( options.disabled ) {
109+
event.stopImmediatePropagation();
110+
}
106111
});
107112

108113
if ( toggleButton ) {

0 commit comments

Comments
 (0)