From 0b7072bf67b2a1cb08951baa03f57fadf712f8fc Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Mon, 11 Dec 2023 16:20:46 +0100 Subject: [PATCH] Fire click event only when using left button --- crates/gpui2/src/elements/div.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rs index 10fd7dda0a..c27ac52cde 100644 --- a/crates/gpui2/src/elements/div.rs +++ b/crates/gpui2/src/elements/div.rs @@ -964,6 +964,7 @@ impl Interactivity { let interactive_bounds = interactive_bounds.clone(); cx.on_mouse_event(move |event: &MouseDownEvent, phase, cx| { if phase == DispatchPhase::Bubble + && event.button == MouseButton::Left && interactive_bounds.visibly_contains(&event.position, cx) { *pending_mouse_down.borrow_mut() = Some(event.clone());