diff --git a/crates/git_ui/src/commit_modal.rs b/crates/git_ui/src/commit_modal.rs index c90e0deade..d7a11e53ba 100644 --- a/crates/git_ui/src/commit_modal.rs +++ b/crates/git_ui/src/commit_modal.rs @@ -62,6 +62,7 @@ pub struct CommitModal { restore_dock: RestoreDock, properties: ModalContainerProperties, branch_list_handle: PopoverMenuHandle, + commit_menu_handle: PopoverMenuHandle, } impl Focusable for CommitModal { @@ -171,7 +172,9 @@ impl CommitModal { let focus_handle = commit_editor.focus_handle(cx); cx.on_focus_out(&focus_handle, window, |this, _, window, cx| { - if !this.branch_list_handle.is_focused(window, cx) { + if !this.branch_list_handle.is_focused(window, cx) + && !this.commit_menu_handle.is_focused(window, cx) + { cx.emit(DismissEvent); } }) @@ -185,6 +188,7 @@ impl CommitModal { restore_dock, properties, branch_list_handle: PopoverMenuHandle::default(), + commit_menu_handle: PopoverMenuHandle::default(), } } @@ -246,6 +250,7 @@ impl CommitModal { .action("Amend...", Amend.boxed_clone()) })) }) + .with_handle(self.commit_menu_handle.clone()) .anchor(Corner::TopRight) }