diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 7aff970f8..4135f1516 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -533,8 +533,10 @@ * @param {object} e Event */ closeMobileMenu: function(e) { - if (e.which === 13) { + var $search = $('#search'); + if (e.which === 13 && $search.is(':focus')) { $('#sidebar').removeClass('expanded'); + $search.blur(); } }, @@ -601,7 +603,7 @@ .prepend( $('
') ); - $search.on('keypress', this.closeMobileMenu); + $(window).on('keypress', this.closeMobileMenu); this.mobileMenu = true; }