Browse Source

Fixes #1916, onChange fires even when selected value is current value

pull/1785/merge
jlukic 9 years ago
parent
commit
6c3b253ebb
1 changed files with 5 additions and 1 deletions
  1. 6
      src/definitions/modules/dropdown.js

6
src/definitions/modules/dropdown.js

@ -965,19 +965,23 @@ $.fn.dropdown = function(parameters) {
module.verbose('Ambiguous dropdown value using strict type check', $choice, value);
if( optionValue === value ) {
$selectedItem = $(this);
return true;
}
else if( !$selectedItem && optionText === value ) {
$selectedItem = $(this);
return true;
}
}
else {
if( optionValue == value ) {
module.verbose('Found select item by value', optionValue, value);
$selectedItem = $(this);
return true;
}
else if( !$selectedItem && optionText == value ) {
module.verbose('Found select item by text', optionText, value);
$selectedItem = $(this);
return true;
}
}
})
@ -1180,7 +1184,7 @@ $.fn.dropdown = function(parameters) {
selectedText,
selectedValue
;
if($selectedItem) {
if($selectedItem && !$selectedItem.hasClass(className.active) ) {
module.debug('Setting selected menu item to', $selectedItem);
module.remove.activeItem();
module.remove.selectedItem();

Loading…
Cancel
Save