diff --git a/public/js/icinga/behavior/dropdown.js b/public/js/icinga/behavior/dropdown.js index a69687414..dd06b1f9a 100644 --- a/public/js/icinga/behavior/dropdown.js +++ b/public/js/icinga/behavior/dropdown.js @@ -32,9 +32,12 @@ */ function clearFocus(e) { var $dropdown = $(this); - if ($(e.target).is($dropdown.find('a').last())) { - $dropdown.removeClass('active'); - } + // Timeout is required to wait for the next element in the DOM to receive focus + setTimeout(function() { + if (! $.contains($dropdown[0], document.activeElement)) { + $dropdown.removeClass('active'); + } + }, 10); } Icinga.Behaviors = Icinga.Behaviors || {};