From 467063a2e25bae25adfa2e9ab789c62e241c9c56 Mon Sep 17 00:00:00 2001 From: jeresig Date: Sat, 13 Feb 2010 04:40:26 -0500 Subject: [PATCH] When binding a change directly to a file input just passthrough to the normal bind. A temporary fix for #5997, needs more investigation. --- src/event.js | 4 ++++ test/delegatetest.html | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/src/event.js b/src/event.js index 17d7673ee..c6a953b2f 100644 --- a/src/event.js +++ b/src/event.js @@ -769,6 +769,10 @@ if ( !jQuery.support.changeBubbles ) { }, setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + for ( var type in changeFilters ) { jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); } diff --git a/test/delegatetest.html b/test/delegatetest.html index 1a785a306..b2840c129 100644 --- a/test/delegatetest.html +++ b/test/delegatetest.html @@ -52,6 +52,8 @@ + + @@ -67,6 +69,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA DOCUMENT @@ -77,6 +80,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA @@ -86,6 +90,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA DOCUMENT @@ -96,6 +101,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA DOCUMENT @@ -106,6 +112,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA @@ -115,6 +122,7 @@ MULTI CHECKBOX RADIO + FILE TEXT TEXTAREA @@ -215,6 +223,7 @@ $(".mselect_test").addChangeTest("#mselect"); $(".checkbox_test").addChangeTest("#checkbox"); $(".radio_test").addChangeTest("#radio"); + $(".file_test").addChangeTest("#file"); $('textarea').addChangeTest("#textarea"); $('#input').addChangeTest("#text"); $(document).bind("change", function(){ -- 2.39.5