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.

Fix git file context menu focus issue (#61339)

Malin Dhamsara Ruwan Pathirana948486f8494f
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 55b1f9ffb25..c84c8c3cb92 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -7226,7 +7226,10 @@ impl GitPanel {
window: &mut Window,
cx: &mut Context<Self>,
) {
- window.focus(&context_menu.focus_handle(cx), cx);
+ let focus_handle = context_menu.focus_handle(cx);
+ window.defer(cx, move |window, cx| {
+ window.focus(&focus_handle, cx);
+ });
let subscription = cx.subscribe_in(
&context_menu,