FIX: closes search-menu on escape (#7804)

FIX: closes search-menu on escape (#7804)

diff --git a/app/assets/javascripts/discourse/widgets/search-menu.js.es6 b/app/assets/javascripts/discourse/widgets/search-menu.js.es6
index 081bf60..c963c18 100644
--- a/app/assets/javascripts/discourse/widgets/search-menu.js.es6
+++ b/app/assets/javascripts/discourse/widgets/search-menu.js.es6
@@ -204,6 +204,12 @@ export default createWidget("search-menu", {
   },
 
   keyDown(e) {
+    if (e.which === 27 /* escape */) {
+      this.sendWidgetAction("toggleSearchMenu");
+      e.preventDefault();
+      return false;
+    }
+
     if (searchData.loading || searchData.noResults) {
       return;
     }

GitHub sha: ea2a9bc4

1 Like