Skip to content

Commit

Permalink
fix(dropdown): dont toggle on "set selected" when no labels are used
Browse files Browse the repository at this point in the history
Closes #670
  • Loading branch information
lubber-de authored and Sean committed Jul 25, 2019
1 parent 313a9fd commit 53c22c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ $.fn.dropdown = function(parameters) {
element = this,
instance = $module.data(moduleNamespace),

selectActionActive,
initialLoad,
pageLostFocus,
willRefocus,
Expand Down Expand Up @@ -1638,6 +1639,7 @@ $.fn.dropdown = function(parameters) {

determine: {
selectAction: function(text, value) {
selectActionActive = true;
module.verbose('Determining action', settings.action);
if( $.isFunction( module.action[settings.action] ) ) {
module.verbose('Triggering preset action', settings.action, text, value);
Expand All @@ -1650,6 +1652,7 @@ $.fn.dropdown = function(parameters) {
else {
module.error(error.action, settings.action);
}
selectActionActive = false;
},
eventInModule: function(event, callback) {
var
Expand Down Expand Up @@ -2671,7 +2674,7 @@ $.fn.dropdown = function(parameters) {
module.set.activeItem($selected);
}
}
else if(!isFiltered) {
else if(!isFiltered && (settings.useLabels || selectActionActive)) {
module.debug('Selected active value, removing label');
module.remove.selected(selectedValue);
}
Expand Down

0 comments on commit 53c22c9

Please sign in to comment.