Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Dismiss git commit modal when it's out of focus (#25518)

Anthony Eid10fef92eeaa7
diff --git a/crates/git_ui/src/commit_modal.rs b/crates/git_ui/src/commit_modal.rs
index 8decb4f82d3..4c6c8cdd845 100644
--- a/crates/git_ui/src/commit_modal.rs
+++ b/crates/git_ui/src/commit_modal.rs
@@ -149,6 +149,13 @@ impl CommitModal {
}
}
+ let focus_handle = commit_editor.focus_handle(cx);
+
+ cx.on_focus_out(&focus_handle, window, |this, _, window, cx| {
+ cx.emit(DismissEvent);
+ })
+ .detach();
+
Self {
git_panel,
commit_editor,