Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Checkpoint
Antonio Scandurra731ce1721ae2
diff --git a/crates/gpui3/src/elements/div.rs b/crates/gpui3/src/elements/div.rsindex c95ca6e8536..a943f4d25b9 100644--- a/crates/gpui3/src/elements/div.rs+++ b/crates/gpui3/src/elements/div.rs@@ -296,6 +296,7 @@ wherecx: &mut ViewContext<V>,) {let click_listeners = mem::take(&mut self.listeners.mouse_click);+let mouse_down = pending_click.lock().clone();if let Some(mouse_down) = mouse_down {cx.on_mouse_event(move |state, event: &MouseUpEvent, phase, cx| {@@ -319,6 +320,15 @@ where});}+ if let Some(focus_handle) = self.focusability.focus_handle() {+ let focus_handle = focus_handle.clone();+ cx.on_mouse_event(move |_, event: &MouseDownEvent, phase, cx| {+ if phase == DispatchPhase::Bubble && bounds.contains_point(&event.position) {+ cx.focus(&focus_handle);+ }+ })+ }+for listener in mem::take(&mut self.listeners.mouse_down) {cx.on_mouse_event(move |state, event: &MouseDownEvent, phase, cx| {listener(state, event, &bounds, phase, cx);