From e63ff5196bf72c36f97b390fa0b31512b18e3931 Mon Sep 17 00:00:00 2001 From: jason4short Date: Thu, 8 Oct 2026 13:39:10 -0700 Subject: [PATCH] =?UTF-8?q?Help=20=E2=80=BA=20Search:=20clicking=20the=20s?= =?UTF-8?q?earch=20field=20keeps=20the=20menu=20open=20(#1027)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Menus close on any click, inside them too (egui's CloseOnClick), so a click in the Help menu's search field closed the menu. The Help menu now closes only on clicks outside it; its items (and search results) close it themselves when chosen. Co-authored-by: Jason Short <3344856+jason4short@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 (1M context) --- crates/ui-egui/src/menus.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/menus.rs b/crates/ui-egui/src/menus.rs index e73520c239..95b7726ff6 100644 --- a/crates/ui-egui/src/menus.rs +++ b/crates/ui-egui/src/menus.rs @@ -834,7 +834,15 @@ pub fn menu_bar(app: &mut PhotocraftApp, ui: &mut egui::Ui) -> f32 { // The release ending the press that opened this menu is a click "outside" the // popup: it must not close it again. let opening = title.clicked() && ui.ctx().data(|d| d.get_temp::(press_gesture_id())).unwrap_or(false); - let close = if opening { egui::PopupCloseBehavior::IgnoreClicks } else { config.close_behavior }; + let close = if opening { + egui::PopupCloseBehavior::IgnoreClicks + } else if top == "Help" { + // Menus close on any click, inside them too; a click in Help's search field + // must keep it open. Its items close it themselves when chosen. + egui::PopupCloseBehavior::CloseOnClickOutside + } else { + config.close_behavior + }; egui::Popup::menu(&title) .open_memory(open) .close_behavior(close)