fix(mobile): improve branch selection dropdown interaction in merge dialog (#526)
- Add modal={false} to DropdownMenu to prevent drawer closing when
dismissing branch selector without selecting
- Remove auto-focus on search input to prevent unwanted keyboard popup
when opening branch selector on mobile
Co-authored-by: Jovines <jovines@qq.com>
This commit is contained in:
committed by
GitHub
co-authored by
Jovines
parent
1b64c826ee
commit
26b95e2bd9
@@ -153,12 +153,6 @@ export const BranchIntegrationSection: React.FC<BranchIntegrationSectionProps> =
|
||||
React.useEffect(() => {
|
||||
if (!branchDropdownOpen) {
|
||||
setBranchSearch('');
|
||||
} else {
|
||||
// Focus the search input when dropdown opens
|
||||
const timer = setTimeout(() => {
|
||||
searchInputRef.current?.focus();
|
||||
}, 0);
|
||||
return () => clearTimeout(timer);
|
||||
}
|
||||
}, [branchDropdownOpen]);
|
||||
|
||||
@@ -288,7 +282,7 @@ export const BranchIntegrationSection: React.FC<BranchIntegrationSectionProps> =
|
||||
<p className="typography-meta text-muted-foreground">
|
||||
{operation === 'merge' ? `Branch to merge into ${targetBranchLabel}` : 'Branch to rebase onto'}
|
||||
</p>
|
||||
<DropdownMenu open={branchDropdownOpen} onOpenChange={setBranchDropdownOpen}>
|
||||
<DropdownMenu open={branchDropdownOpen} onOpenChange={setBranchDropdownOpen} modal={false}>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="outline" className="w-full justify-between h-10">
|
||||
<span className={cn('truncate', !selectedBranch && 'text-muted-foreground')}>
|
||||
|
||||
Reference in New Issue
Block a user