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"