project_panel: Focus project panel when clicking empty space (#39489)

Closes #39486

Release Notes:

- Fixed: Project Panel now properly focuses when clicking empty space,
allowing keyboard shortcuts to work as expected
This commit is contained in:
ozer
2025-10-06 20:50:56 +05:30
committed by GitHub
parent db5b1a31b5
commit e7339fbd42
+2 -1
View File
@@ -5771,13 +5771,14 @@ impl Render for ProjectPanel {
cx.stop_propagation();
},
))
.on_click(cx.listener(|this, event, _, cx| {
.on_click(cx.listener(|this, event, window, cx| {
if matches!(event, gpui::ClickEvent::Keyboard(_)) {
return;
}
cx.stop_propagation();
this.state.selection = None;
this.marked_entries.clear();
this.focus_handle(cx).focus(window);
}))
.on_mouse_down(
MouseButton::Right,