Browse Source

Fix search removes filter before hiding

pull/2169/head
jlukic 9 years ago
parent
commit
960c82cad2
2 changed files with 16 additions and 12 deletions
  1. 26
      src/definitions/modules/dropdown.js
  2. 2
      src/themes/default/modules/dropdown.variables

26
src/definitions/modules/dropdown.js

@ -766,7 +766,6 @@ $.fn.dropdown = function(parameters) {
isBubbledEvent = ($subMenu.find($target).length > 0)
;
if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {
module.remove.searchTerm();
module.determine.selectAction.call(this, text, value);
}
}
@ -1106,9 +1105,7 @@ $.fn.dropdown = function(parameters) {
return;
}
else {
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
}
},
@ -1123,15 +1120,11 @@ $.fn.dropdown = function(parameters) {
: text
;
module.set.selected(value, $(this));
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
},
hide: function() {
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
}
},
@ -1691,7 +1684,6 @@ $.fn.dropdown = function(parameters) {
searchTerm: function() {
module.verbose('Cleared search term');
$search.val('');
module.remove.filteredItem();
},
selected: function(value) {
var
@ -2005,6 +1997,18 @@ $.fn.dropdown = function(parameters) {
}
},
hideAndClear: function() {
if(module.is.searchSelection()) {
module.remove.searchTerm();
module.hide(function() {
module.remove.filteredItem();
});
}
else {
module.hide();
}
},
delay: {
show: function() {
module.verbose('Delaying show event to ensure user intent');

2
src/themes/default/modules/dropdown.variables

@ -22,7 +22,7 @@
@dropdownIconMargin: 0em 0em 0em 1em;
/* Current Text */
@textTransition: color @transitionDuration @defaultEasing;
@textTransition: none;
/* Menu */
@menuBackground: #FFFFFF;

Loading…
Cancel
Save