This commit is contained in:
dengqichen 2025-01-10 10:34:19 +08:00
parent 70f19f230d
commit 0fe5f766c8

View File

@ -299,19 +299,28 @@ const ApplicationModal: React.FC<ApplicationModalProps> = ({
</Button> </Button>
</FormControl> </FormControl>
</PopoverTrigger> </PopoverTrigger>
<PopoverContent className="w-full p-0"> <PopoverContent className="w-[--radix-popover-trigger-width] p-0" side="bottom" align="start">
<Command> <Command className="w-full">
<CommandInput placeholder="搜索代码仓库组..." /> <CommandInput
placeholder="搜索代码仓库组..."
className="h-9"
/>
<CommandEmpty></CommandEmpty> <CommandEmpty></CommandEmpty>
<CommandGroup> <ScrollArea className="h-[200px] overflow-auto">
<ScrollArea className="h-60"> <CommandGroup className="overflow-hidden">
{repositoryGroups.map((group) => ( {repositoryGroups.map((group) => (
<CommandItem <CommandItem
value={group.name}
key={group.id} key={group.id}
value={group.name}
onSelect={() => { onSelect={() => {
form.setValue("repositoryGroupId", group.id); form.setValue("repositoryGroupId", group.id);
// 关闭 Popover
const popoverTrigger = document.querySelector('[role="combobox"]');
if (popoverTrigger) {
(popoverTrigger as HTMLElement).click();
}
}} }}
className="cursor-pointer"
> >
<Check <Check
className={cn( className={cn(
@ -324,8 +333,8 @@ const ApplicationModal: React.FC<ApplicationModalProps> = ({
{group.name} {group.name}
</CommandItem> </CommandItem>
))} ))}
</ScrollArea>
</CommandGroup> </CommandGroup>
</ScrollArea>
</Command> </Command>
</PopoverContent> </PopoverContent>
</Popover> </Popover>