Skip to content

Commit

Permalink
#2573 Fixes <select> will not add option values with remote data.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Jul 10, 2015
1 parent cc2d03d commit e61b39c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/definitions/modules/dropdown.js
Expand Up @@ -2091,7 +2091,7 @@ $.fn.dropdown = function(parameters) {
}
}

if($input.is('select') && settings.apiSettings) {
if( $input.is('select') && (settings.allowAdditions || settings.apiSettings) ) {
module.debug('Adding an option to the select before setting the value', value);
module.add.optionValue(value);
}
Expand Down Expand Up @@ -2357,11 +2357,9 @@ $.fn.dropdown = function(parameters) {
newValue = [addedValue];
}
// add values
if( $input.is('select')) {
if(settings.allowAdditions) {
module.add.optionValue(addedValue);
module.debug('Adding value to select', addedValue, newValue, $input);
}
if( $input.is('select') && (settings.allowAdditions || settings.apiSettings) ) {
module.add.optionValue(addedValue);
module.debug('Adding value to select', addedValue, newValue, $input);
}
else {
newValue = newValue.join(settings.delimiter);
Expand Down

0 comments on commit e61b39c

Please sign in to comment.