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) isBubbledEvent = ($subMenu.find($target).length > 0)
; ;
if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) { if(!isBubbledEvent && (!hasSubMenu || settings.allowCategorySelection)) {
module.remove.searchTerm();
module.determine.selectAction.call(this, text, value); module.determine.selectAction.call(this, text, value);
} }
} }
@ -1106,9 +1105,7 @@ $.fn.dropdown = function(parameters) {
return; return;
} }
else { else {
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
} }
}, },
@ -1123,15 +1120,11 @@ $.fn.dropdown = function(parameters) {
: text : text
; ;
module.set.selected(value, $(this)); module.set.selected(value, $(this));
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
}, },
hide: function() { hide: function() {
module.hide(function() {
module.remove.filteredItem();
});
module.hideAndClear();
} }
}, },
@ -1691,7 +1684,6 @@ $.fn.dropdown = function(parameters) {
searchTerm: function() { searchTerm: function() {
module.verbose('Cleared search term'); module.verbose('Cleared search term');
$search.val(''); $search.val('');
module.remove.filteredItem();
}, },
selected: function(value) { selected: function(value) {
var 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: { delay: {
show: function() { show: function() {
module.verbose('Delaying show event to ensure user intent'); 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; @dropdownIconMargin: 0em 0em 0em 1em;
/* Current Text */ /* Current Text */
@textTransition: color @transitionDuration @defaultEasing;
@textTransition: none;
/* Menu */ /* Menu */
@menuBackground: #FFFFFF; @menuBackground: #FFFFFF;

Loading…
Cancel
Save