From f59f40d0f9855f43307a8b100a3d08f646c73538 Mon Sep 17 00:00:00 2001 From: Haileyesus Date: Tue, 24 Feb 2026 14:02:40 +0300 Subject: [PATCH] fix(git=panel): escape now works for closing new branch modal --- src/components/git-panel/view/modals/NewBranchModal.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/components/git-panel/view/modals/NewBranchModal.tsx b/src/components/git-panel/view/modals/NewBranchModal.tsx index f7bef11..1c95f77 100644 --- a/src/components/git-panel/view/modals/NewBranchModal.tsx +++ b/src/components/git-panel/view/modals/NewBranchModal.tsx @@ -70,7 +70,16 @@ export default function NewBranchModal({ onChange={(event) => setNewBranchName(event.target.value)} onKeyDown={(event) => { if (event.key === 'Enter' && !isCreatingBranch) { + event.preventDefault(); + event.stopPropagation(); void handleCreateBranch(); + return; + } + + if (event.key === 'Escape' && !isCreatingBranch) { + event.preventDefault(); + event.stopPropagation(); + onClose(); } }} placeholder="feature/new-feature"