From 0b210e0fc325153547ec8c0dce3102407572baf1 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Thu, 21 Nov 2024 07:39:47 +0100 Subject: [PATCH] FIX: correctly closes search menu on escape (#29848) Prior to this fix the menu would not close if a child was in focus, and the search suggestions had a special implementation to handle this. The fix now relies on trapping the keydown escape event on the top dip of the search menu. --- .../discourse/app/components/search-menu.hbs | 7 ++++++- .../discourse/app/components/search-menu.js | 7 +++++++ .../components/search-menu/results/assistant-item.js | 12 +++--------- .../app/components/search-menu/results/assistant.hbs | 7 ------- .../discourse/tests/acceptance/search-test.js | 12 +++++++++++- 5 files changed, 27 insertions(+), 18 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/search-menu.hbs b/app/assets/javascripts/discourse/app/components/search-menu.hbs index 9bc89954b24..ba9d259db5a 100644 --- a/app/assets/javascripts/discourse/app/components/search-menu.hbs +++ b/app/assets/javascripts/discourse/app/components/search-menu.hbs @@ -1,4 +1,9 @@ -
+
{{#if this.search.inTopicContext}}