Change summary
crates/project_panel/src/project_panel.rs | 7 +++++++
1 file changed, 7 insertions(+)
Detailed changes
@@ -281,6 +281,7 @@ impl ProjectPanel {
let focus_handle = cx.focus_handle();
cx.on_focus(&focus_handle, Self::focus_in).detach();
cx.on_focus_out(&focus_handle, |this, _, cx| {
+ this.focus_out(cx);
this.hide_scrollbar(cx);
})
.detach();
@@ -595,6 +596,12 @@ impl ProjectPanel {
}
}
+ fn focus_out(&mut self, cx: &mut ViewContext<Self>) {
+ if !self.focus_handle.is_focused(cx) {
+ self.confirm(&Confirm, cx);
+ }
+ }
+
fn deploy_context_menu(
&mut self,
position: Point<Pixels>,