jQuery._data( elem, "_change_data", val );
}
- if ( val !== old && old != null && elem.parentNode ) {
- simulate( "change", elem.parentNode, e, true );
+ if ( val !== old && old != null ) {
+ simulate( "change", elem, e, true );
}
},
jQuery.event.special.change = {
setup: function( data, namespaces ) {
- if ( this.type === "file" ) {
+ // If this is a real input element, no need to fake change
+ if ( rformElems.test( this.nodeName ) ) {
return false;
}
-
for ( var type in changeFilters ) {
jQuery.event.add( this, type + "._change", changeFilters[ type ] );
}
-
- return rformElems.test( this.nodeName );
},
teardown: function( namespaces ) {
+ if ( rformElems.test( this.nodeName ) ) {
+ return false;
+ }
jQuery.event.remove( this, "._change" );
-
- return rformElems.test( this.nodeName );
}
};
}