You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i'm building a form that is encapsulated in a Dialog component that is triggered with a button, in the form i have a field for selecting date, so i decided to choose the calendar component that is supposed to show when the calendar is clicked, but clicking the calendar once does not show the date picker, until you double click or triple click rapidly then it displays the date picker, please how do i fix this problem:
here is the code:
<Dialog><DialogTriggerasChild><ButtononClick={()=>handleUpload("Helo world",orgId)}>
Upload File
</Button></DialogTrigger><DialogContent><DialogHeader><DialogTitleclassName="mb-5">Upload your files here</DialogTitle><DialogDescription><Form{...form}><formonSubmit={form.handleSubmit(onSubmit)}className="space-y-8"><FormFieldcontrol={form.control}name="title"render={({ field })=>(<FormItem><FormLabel>Title</FormLabel><FormControl><Inputplaceholder="Tender Document"{...field}/></FormControl><FormMessage/></FormItem>)}/><FormFieldcontrol={form.control}name="description"render={({ field })=>(<FormItem><FormLabel>Tender escription</FormLabel><FormControl><Textareaplaceholder="Enter tender description"className="resize-none"{...field}/></FormControl><FormMessage/></FormItem>)}/><divclassName="flex items-center justify-between gap-4"><FormFieldcontrol={form.control}name="deadline"render={({ field })=>(<FormItemclassName="flex flex-col"><FormLabel>Tender deadline</FormLabel><PopoverasChild><PopoverTriggerasChild><FormControl><ButtononSelect={(e)=>e.preventDefault()}variant={"outline"}className={cn("z-30 w-[240px] pl-3 text-left font-normal",!field.value&&"text-muted-foreground")}>{field.value ? (format(field.value,"PPP")) : (<span>Pick a date</span>)}<CalendarIconclassName="ml-auto h-4 w-4 opacity-50"/></Button></FormControl></PopoverTrigger><PopoverContentclassName="w-auto p-0"align="start"><Calendarmode="single"selected={field.value}onSelect={field.onChange}disabled={(date)=>date<newDate(newDate().setHours(0,0,0,0))}initialFocus/></PopoverContent></Popover><FormMessage/></FormItem>)}/><FormFieldcontrol={form.control}name="file"render={({field: {onChange}, ...field})=>(<FormItemclassName="mb-1"><FormLabel>File</FormLabel><FormControlclassName="h-9"><Inputtype="file"{...field}onChange={(event)=>{if(!event.target.files)return;onChange(event.target.files[0]);}}/></FormControl><FormMessage/></FormItem>)}/></div><Buttontype="submit"className="w-full">
Submit
</Button></form></Form></DialogDescription></DialogHeader><DialogFooter></DialogFooter></DialogContent></Dialog>
The text was updated successfully, but these errors were encountered:
Yes, I resolved the issue by creating a custom Dialog component. The conflict was due to event handlers from the Modal and Calendar components clashing. I addressed this by implementing a custom Modal and utilizing Shadcn cards without the built-in popover. Here is the link to the code where I integrated the custom popover with the Forms and Calendar component:
Bug report
Current Behavior
i'm building a form that is encapsulated in a Dialog component that is triggered with a button, in the form i have a field for selecting date, so i decided to choose the calendar component that is supposed to show when the calendar is clicked, but clicking the calendar once does not show the date picker, until you double click or triple click rapidly then it displays the date picker, please how do i fix this problem:
here is the code:
The text was updated successfully, but these errors were encountered: