From cd4bac8e226e20efbaa27000b7137688f82d5c25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Sat, 9 May 2026 22:20:58 -0400 Subject: [PATCH] Stop propagation on workspace popover dismiss click MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backdrop closed the picker on mouse_down but didn't consume the event. The same press would propagate to the top div and the same click sequence's mouse_up could then land on whatever element ended up under the cursor (a tab, a button) once the backdrop unmounted on the next render — dismissing the popover would inadvertently fire a second action. Add `cx.stop_propagation()` after the close so the dismiss click ends at the backdrop. Standard popover semantics: outside-click closes, consumed. --- crates/ely_app/src/shell/chrome/sidebar_header.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/ely_app/src/shell/chrome/sidebar_header.rs b/crates/ely_app/src/shell/chrome/sidebar_header.rs index c4656e3..410cf0c 100644 --- a/crates/ely_app/src/shell/chrome/sidebar_header.rs +++ b/crates/ely_app/src/shell/chrome/sidebar_header.rs @@ -210,8 +210,9 @@ pub(crate) fn render_workspace_disclosure( } /// Transparent fullscreen backdrop layered between the layout grid -/// and the disclosure. Any click on it closes the picker; the -/// disclosure paints after this backdrop so it remains interactive. +/// and the disclosure. Press on it closes the picker AND consumes +/// the event so the dismiss-click doesn't ricochet into a button +/// underneath the cursor. pub(crate) fn render_workspace_disclosure_backdrop( cx: &mut Context, ) -> AnyElement { @@ -223,6 +224,7 @@ pub(crate) fn render_workspace_disclosure_backdrop( gpui::MouseButton::Left, cx.listener(|shell, _: &gpui::MouseDownEvent, _, cx| { shell.close_workspace_picker(cx); + cx.stop_propagation(); }), ) .into_any_element()