Bug Tracker

Ticket #4878: attributes.diff

File attributes.diff, 774 bytes (added by bennettmcelwee, 3 years ago)

Proper patch file for rev 6333.

  • attributes.js

     
    9898                                        jQuery.inArray(this.name, value) >= 0); 
    9999 
    100100                        else if ( jQuery.nodeName( this, "select" ) ) { 
    101                                 var values = jQuery.makeArray(value); 
     101                                var values = jQuery.makeArray(value), 
     102                                        one = this.type == "select-one", 
     103                                        canSelect = true; 
    102104 
    103105                                jQuery( "option", this ).each(function(){ 
    104                                         this.selected = (jQuery.inArray( this.value, values ) >= 0 || 
     106                                        this.selected = canSelect && (jQuery.inArray( this.value, values ) >= 0 || 
    105107                                                jQuery.inArray( this.text, values ) >= 0); 
     108                                        if (this.selected && one) 
     109                                                canSelect = false; 
    106110                                }); 
    107111 
    108112                                if ( !values.length )