diff --git a/modules/mod_ginger_base/lib/js/search-suggestions.js b/modules/mod_ginger_base/lib/js/search-suggestions.js index d8f09f9e..eb4d4bbf 100644 --- a/modules/mod_ginger_base/lib/js/search-suggestions.js +++ b/modules/mod_ginger_base/lib/js/search-suggestions.js @@ -49,6 +49,11 @@ this._closeSearch(); } break; + + case 'OnBlur': { + this._closeSearch(); + } + break; } }, @@ -122,12 +127,16 @@ } - $(document).on('keyup', function(e) { + me.element.on('keyup', function(e) { if (e.keyCode === 13) { me.update('OnReturnPressed'); } }); + me.element.on('blur', function() { + me.update('OnBlur'); + }) + me.element.on('keyup', function(e) { var key = e.keyCode; var inputValue = e.currentTarget.value;