From 09f8ff00548d2e7fafd3b9a050e9e4a73f157ce6 Mon Sep 17 00:00:00 2001 From: jlukic Date: Wed, 22 Oct 2014 13:30:08 -0400 Subject: [PATCH] Better fix for search input blur bug --- src/definitions/modules/dropdown.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/definitions/modules/dropdown.js b/src/definitions/modules/dropdown.js index 304811289..e577eab44 100644 --- a/src/definitions/modules/dropdown.js +++ b/src/definitions/modules/dropdown.js @@ -306,6 +306,7 @@ $.fn.dropdown = function(parameters) { ; } $module + .on('mousedown' + eventNamespace, selector.item, module.event.item.mousedown) .on('mouseenter' + eventNamespace, selector.item, module.event.item.mouseenter) .on('mouseleave' + eventNamespace, selector.item, module.event.item.mouseleave) .on('click' + eventNamespace, selector.item, module.event.item.click) @@ -408,8 +409,9 @@ $.fn.dropdown = function(parameters) { module.show(); }, searchBlur: function(event) { - // give enough time for events to bubble - setTimeout(module.hide, 50); + if(!activated) { + module.hide(); + } }, input: function(event) { var @@ -527,6 +529,10 @@ $.fn.dropdown = function(parameters) { item: { + mousedown: function() { + activated = true; + }, + mouseenter: function(event) { var $currentMenu = $(this).find(selector.menu),