Permalink
Browse files

Button: stop disabled button from firing click events. fixes #5945. B…

…ehavior was inconsisten between BUTTON and A elements.

(cherry picked from commit a7f1659)
  • Loading branch information...
1 parent 870977a commit 4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43 @eikes eikes committed with scottgonzalez May 5, 2011
Showing with 5 additions and 0 deletions.
  1. +5 −0 ui/jquery.ui.button.js
View
5 ui/jquery.ui.button.js
@@ -102,6 +102,11 @@ $.widget( "ui.button", {
})
.bind( "blur.button", function() {
$( this ).removeClass( focusClass );
+ })
+ .bind( "click.button", function( event ) {
+ if ( options.disabled ) {
+ event.stopImmediatePropagation();
+ }
});
if ( toggleButton ) {

0 comments on commit 4c218ee

Please sign in to comment.