From: Dan Heberden Date: Fri, 18 Feb 2011 18:09:07 +0000 (-0800) Subject: Bug #6911 - Prevent action on disabled elements, both triggering and bound via .live() X-Git-Tag: 1.5.1rc1~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=47abe5e1da5bcb5a268aefea9817b8747b051b18;p=jquery.git Bug #6911 - Prevent action on disabled elements, both triggering and bound via .live() --- diff --git a/src/event.js b/src/event.js index 1bfb4bbcf..f7e0a08c0 100644 --- a/src/event.js +++ b/src/event.js @@ -1099,7 +1099,7 @@ function liveHandler( event ) { for ( j = 0; j < live.length; j++ ) { handleObj = live[j]; - if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) { elem = close.elem; related = null; diff --git a/test/delegatetest.html b/test/delegatetest.html index 6479d26ec..c4f33aaea 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -11,63 +11,71 @@

Change Tests

- - - - - - - - - - - - + + + + + + + + + + + + + @@ -79,6 +87,7 @@ + @@ -89,6 +98,7 @@ + @@ -100,6 +110,7 @@ + @@ -111,6 +122,7 @@ + @@ -121,11 +133,24 @@ + + + + + + + + + + + + +
- Change each: - - - - - - - -
- - - - -
- -
- - - - -
- - - - - - - $(document).bind('change')
+ Change each: + + + + + + + +
+ +
+ + +
+
+
+
+
+
+ +
+ +
+ + +
+ + + + + + + $(document).bind('change')
+ $(document).bind('click') +
Live: SELECT MULTI CHECKBOXBUTTON RADIO FILE TEXTSELECT MULTI CHECKBOXBUTTON RADIO FILE TEXTSELECT MULTI CHECKBOXBUTTON RADIO FILE TEXTSELECT MULTI CHECKBOXBUTTON RADIO FILE TEXTSELECT MULTI CHECKBOXBUTTON RADIO FILE TEXTSELECT MULTI CHECKBOXBUTTON RADIO FILE TEXT TEXTAREA
Live Click:SELECTMULTICHECKBOXBUTTONRADIOFILETEXTTEXTAREADOCUMENT

Submit Tests

@@ -162,7 +187,7 @@