We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Popover's scrollbar does not work in the Dialog component
Popover and Dialog
'use client';
import { zodResolver } from '@hookform/resolvers/zod'; import { Check, ChevronsUpDown } from 'lucide-react'; import { useForm } from 'react-hook-form'; import { z } from 'zod'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, } from '@/components/ui/command'; import { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, } from '@/components/ui/form'; import { Popover, PopoverContent, PopoverTrigger, } from '@/components/ui/popover';
const languages = [ { label: 'English', value: 'en' }, { label: 'French', value: 'fr' }, { label: 'German', value: 'de' }, { label: 'Spanish', value: 'es' }, { label: 'Portuguese', value: 'pt' }, { label: 'Russian', value: 'ru' }, { label: 'Japanese', value: 'ja' }, { label: 'Korean', value: 'ko' }, { label: 'Chinese', value: 'zh' }, ] as const;
const FormSchema = z.object({ language: z.string({ required_error: 'Please select a language.', }), });
export function DialogText() { const form = useForm<z.infer>({ resolver: zodResolver(FormSchema), });
function onSubmit(data: z.infer) {}
return ( Edit Profile Edit profile Make changes to your profile here. Click save when you're done. <Form {...form}>
No response
mac
The text was updated successfully, but these errors were encountered:
Have you tried to apply modal={true} to your Popover?
modal={true}
Sorry, something went wrong.
No branches or pull requests
Describe the bug
Popover's scrollbar does not work in the Dialog component
Affected component/components
Popover and Dialog
How to reproduce
'use client';
import { zodResolver } from '@hookform/resolvers/zod';
import { Check, ChevronsUpDown } from 'lucide-react';
import { useForm } from 'react-hook-form';
import { z } from 'zod';
import { Button } from '@/components/ui/button';
import {
Dialog,
DialogContent,
DialogDescription,
DialogFooter,
DialogHeader,
DialogTitle,
DialogTrigger,
} from '@/components/ui/dialog';
import { cn } from '@/lib/utils';
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from '@/components/ui/command';
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from '@/components/ui/form';
import {
Popover,
PopoverContent,
PopoverTrigger,
} from '@/components/ui/popover';
const languages = [
{ label: 'English', value: 'en' },
{ label: 'French', value: 'fr' },
{ label: 'German', value: 'de' },
{ label: 'Spanish', value: 'es' },
{ label: 'Portuguese', value: 'pt' },
{ label: 'Russian', value: 'ru' },
{ label: 'Japanese', value: 'ja' },
{ label: 'Korean', value: 'ko' },
{ label: 'Chinese', value: 'zh' },
] as const;
const FormSchema = z.object({
language: z.string({
required_error: 'Please select a language.',
}),
});
export function DialogText() {
const form = useForm<z.infer>({
resolver: zodResolver(FormSchema),
});
function onSubmit(data: z.infer) {}
return (
Edit Profile
Edit profile
Make changes to your profile here. Click save when you're done.
<Form {...form}>
<FormField
control={form.control}
name="language"
render={({ field }) => (
Language
<Button
variant="outline"
role="combobox"
className={cn(
'w-[200px] justify-between',
!field.value && 'text-muted-foreground',
)}
>
{field.value
? languages.find(
(language) => language.value === field.value,
)?.label
: 'Select language'}
No language found.
{languages.map((language) => (
<CommandItem
value={language.label}
key={language.value}
onSelect={() => {
form.setValue('language', language.value);
}}
>
{language.label}
<Check
className={cn(
'ml-auto',
language.value === field.value
? 'opacity-100'
: 'opacity-0',
)}
/>
))}
This is the language that will be used in the dashboard.
)}
/>
Submit
Save changes
);
}
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Before submitting
The text was updated successfully, but these errors were encountered: