From d147db1db90434ab0a95cddc6121d00d5a380c4e Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Wed, 13 Dec 2023 11:23:05 +0100 Subject: [PATCH] Don't mark interactive element as active if default prevented --- crates/gpui2/src/elements/div.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/gpui2/src/elements/div.rs b/crates/gpui2/src/elements/div.rs index a3a071453ef192f0d9089d8727bb894fc376d442..42e795716f89e5cfe42d625d84133ae0587c64ed 100644 --- a/crates/gpui2/src/elements/div.rs +++ b/crates/gpui2/src/elements/div.rs @@ -1018,7 +1018,7 @@ impl Interactivity { .and_then(|group_active| GroupBounds::get(&group_active.group, cx)); let interactive_bounds = interactive_bounds.clone(); cx.on_mouse_event(move |down: &MouseDownEvent, phase, cx| { - if phase == DispatchPhase::Bubble { + if phase == DispatchPhase::Bubble && !cx.default_prevented() { let group = active_group_bounds.map_or(false, |bounds| bounds.contains(&down.position)); let element = interactive_bounds.visibly_contains(&down.position, cx);