From 090fd16a2e1a04338a3d705fb10afc77f3929f27 Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 02:08:33 +0000 Subject: [PATCH] Restore generic modal closing on mouse click (#45183) (cherry-pick to preview) (#45185) Cherry-pick of #45183 to preview ---- Was removed in https://github.com/zed-industries/zed/pull/44887/changes#diff-1de872be76a27a9d574a0b0acec4581797446e60743d23b3e7a5f15088fa7e61 Release Notes: - (Preview only) Fixed certain modals not being dismissed on mouse click outside Co-authored-by: Kirill Bulatov --- crates/workspace/src/modal_layer.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/workspace/src/modal_layer.rs b/crates/workspace/src/modal_layer.rs index d6f10f703100d89bef5babd4baa590df5fa0c8fd..fec26e9a8e767175a03aa343ebc36f43103af7cf 100644 --- a/crates/workspace/src/modal_layer.rs +++ b/crates/workspace/src/modal_layer.rs @@ -180,6 +180,12 @@ impl Render for ModalLayer { background.fade_out(0.2); this.bg(background) }) + .on_mouse_down( + MouseButton::Left, + cx.listener(|this, _, window, cx| { + this.hide_modal(window, cx); + }), + ) .child( v_flex() .h(px(0.0))