diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 67aff361f0..e6d1d1bfc0 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -494,6 +494,7 @@ $.fn.dropdown = function(parameters) { $module .on('mousedown' + eventNamespace, selector.menu, module.event.menu.mousedown) .on('mouseup' + eventNamespace, selector.menu, module.event.menu.mouseup) + .on('click' + eventNamespace, selector.icon, module.event.icon.click) .on('click' + eventNamespace, selector.search, module.show) .on('focus' + eventNamespace, selector.search, module.event.search.focus) .on('blur' + eventNamespace, selector.search, module.event.search.blur) @@ -501,13 +502,14 @@ $.fn.dropdown = function(parameters) { ; if(module.is.multiple()) { $module - .on('click' + eventNamespace, module.event.click) + .on('click' + eventNamespace, module.event.click) ; } } else { if(settings.on == 'click') { $module + .on('click' + eventNamespace, selector.icon, module.event.icon.click) .on('click' + eventNamespace, module.event.test.toggle) ; } @@ -779,7 +781,7 @@ $.fn.dropdown = function(parameters) { $target = $(event.target) ; // focus search - if(($target.is($module) || $target.is($icon)) && !module.is.focusedOnSearch()) { + if($target.is($module) && !module.is.focusedOnSearch()) { module.focusSearch(); } }, @@ -823,6 +825,13 @@ $.fn.dropdown = function(parameters) { } } }, + icon: { + click: function(event) { + console.log('icon close'); + module.toggle(); + event.stopPropagation(); + } + }, text: { focus: function(event) { activated = true;