]> source.dussan.org Git - jquery.git/commitdiff
Event: Use form prop so that a propHook can be used
authorAdrian Olek <adrianolek@gmail.com>
Wed, 12 Aug 2015 13:20:11 +0000 (15:20 +0200)
committerMichał Gołębiowski <m.goleb@gmail.com>
Mon, 14 Sep 2015 19:49:45 +0000 (21:49 +0200)
Fixes gh-2332
Closes gh-2575

src/event.js

index c7964cb995672912652a55a5f29e81ccb5b1fc9d..6cb4db55173fac0851b6265202d0573c24241813 100644 (file)
@@ -922,7 +922,12 @@ if ( !support.submit ) {
                                // Node name check avoids a VML-related crash in IE (#9807)
                                var elem = e.target,
                                        form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ?
-                                               elem.form :
+
+                                               // Support: IE <=8
+                                               // We use jQuery.prop instead of elem.form
+                                               // to allow fixing the IE8 delegated submit issue (gh-2332)
+                                               // by 3rd party polyfills/workarounds.
+                                               jQuery.prop( elem, "form" ) :
                                                undefined;
 
                                if ( form && !jQuery._data( form, "submit" ) ) {