diff --git a/assets/js/offline-search.js b/assets/js/offline-search.js index 3ff5df1f..9d775015 100644 --- a/assets/js/offline-search.js +++ b/assets/js/offline-search.js @@ -172,7 +172,8 @@ //Bring focus to search bar $(document).on('keydown', function (event) { - if (event.key === '/' ) { + if (event.key === '/' && !(document.activeElement instanceof HTMLInputElement)) { + event.preventDefault(); $searchInput.focus(); } }); @@ -193,6 +194,10 @@ } }); + $searchInput.on('blur', function () { + $searchInput.val(''); + $searchInput.trigger('change'); + }); + }); })(jQuery); - \ No newline at end of file