diff --git a/apps/v4/registry/new-york-v4/ui/command.tsx b/apps/v4/registry/new-york-v4/ui/command.tsx index fdfcbccb763..36e8b12da57 100644 --- a/apps/v4/registry/new-york-v4/ui/command.tsx +++ b/apps/v4/registry/new-york-v4/ui/command.tsx @@ -64,6 +64,16 @@ function CommandInput({ className, ...props }: React.ComponentProps) { + const inputRef = React.useRef(null) + + React.useEffect(() => { + if (props.autoFocus && inputRef.current) { + requestAnimationFrame(() => { + inputRef.current?.focus() + }) + } + }, [props.autoFocus]) + return (