mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-09-02 01:20:23 +08:00
feat(ui): conditional model selector shadow logic (#681)
* feat(ui): conditional model selector shadow logic (#678) - Update ModelSelectorList to conditionally render shadow based on scroll state - Update CommandList to forward ref for scroll detection - Resolves #678 * Update components/ui/command.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix(ui): update listRef type to match CommandList forwarded ref --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d752524851
commit
7fbc857d3a
@@ -77,12 +77,13 @@ function CommandInput({
|
||||
)
|
||||
}
|
||||
|
||||
function CommandList({
|
||||
className,
|
||||
...props
|
||||
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
||||
const CommandList = React.forwardRef<
|
||||
React.ElementRef<typeof CommandPrimitive.List>,
|
||||
React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
|
||||
>(({ className, ...props }, ref) => {
|
||||
return (
|
||||
<CommandPrimitive.List
|
||||
ref={ref}
|
||||
data-slot="command-list"
|
||||
className={cn(
|
||||
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
||||
@@ -91,7 +92,8 @@ function CommandList({
|
||||
{...props}
|
||||
/>
|
||||
)
|
||||
}
|
||||
})
|
||||
CommandList.displayName = CommandPrimitive.List.displayName ?? "CommandList"
|
||||
|
||||
function CommandEmpty({
|
||||
...props
|
||||
|
||||
Reference in New Issue
Block a user