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