From 4c218eeb0a4e6b06d055fcfe0b45ff034ecbfa43 Mon Sep 17 00:00:00 2001 From: Eike Send Date: Thu, 5 May 2011 14:45:06 +0200 Subject: [PATCH] Button: stop disabled button from firing click events. fixes #5945. Behavior was inconsisten between BUTTON and A elements. (cherry picked from commit a7f1659cdc99222a733ed2edbd7d00dc57c30227) --- ui/jquery.ui.button.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/jquery.ui.button.js b/ui/jquery.ui.button.js index a98e96f46f4..bc8357c089d 100644 --- a/ui/jquery.ui.button.js +++ b/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 ) {