Replies: 6 comments 10 replies
-
same issue, anyone found a good solution to this? im using this <DrawerTrigger
onClick={(e) => {
e.currentTarget.blur();
}}
> |
Beta Was this translation helpful? Give feedback.
-
I am not sure if this is the correct way but it works for me <Drawer open={openDrawer} onOpenChange={setOpenDrawer} autoFocus={openDrawer} /> or <DrawerTrigger autoFocus={openDrawer} /> |
Beta Was this translation helpful? Give feedback.
-
Hey guys, found another solution to this problem, it won't relieve the accessibility warning, but it wouldn't prevent the click events on the UI elements OrdersActionsJust keep it modular and scalable
So before the applied solution, the opening of the modal and the drawer would cause the clicking event issue And here's the solution for resolving it
Just added a bit of a delay before triggering details and pdf viewer, and boy it works, though you still have the aria-hidden warning, but I mean it works |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
In case when you want to use Dialog within DropdownMenu (shadcn components), Write like this ...</..> |
Beta Was this translation helpful? Give feedback.
-
I had a similar issue while I was doing my task management app with My setup was pretty standard: I had a Dialog acting as my main modal for a task form. Inside it, I put a Popover for a datepicker, which used My first headache was with the Popover. Initially, I didn't even have The solution here was to remove <Dialog open={isOpen} onOpenChange={handleClose} modal> {* <--- Main dialog is modal: handles global focus trap *}
<DialogContent className="sm:max-w-[425px]">
<DialogHeader>
<DialogTitle>
{isEditing ? "Edit Task" : "Create New Task"}
</DialogTitle>
<DialogDescription>
{isEditing
? "Modify the task details as needed."
: "Fill in the details for your new task. Click save when you're ready."
}
</DialogDescription>
</DialogHeader>
<form onSubmit={handleSubmit} className="space-y-4">
<div className="space-y-2">
<Label htmlFor="title">Title <span className="text-red-500">*</span></Label>
<Input
id="title"
placeholder="Enter task title"
value={title}
onChange={(e) => setTitle(e.target.value)}
required
/>
</div>
<div className="space-y-2">
<Label htmlFor="description">Description (optional)</Label>
<Textarea
id="description"
placeholder="Add a description..."
value={description}
onChange={(e) => setDescription(e.target.value)}
rows={3}
/>
</div>
<div className="space-y-2">
<Label>Due Date (optional)</Label>
<Popover modal={false} open={isCalendarOpen} onOpenChange={setIsCalendarOpen}>
<PopoverTrigger asChild>
<Button
variant="outline"
className={cn(
"w-full justify-start text-left font-normal",
!dueDate && "text-muted-foreground"
)}
type="button"
onClick={() => setIsCalendarOpen(!isCalendarOpen)}
>
<CalendarIcon className="mr-2 h-4 w-4" />
{dueDate ? format(dueDate, "PPP", { locale: es }) : "Select a date"}
</Button>
</PopoverTrigger>
<PopoverContent
className="w-auto p-0 pointer-events-auto" {* <--- This makes the Popover content (like the calendar) clickable *}
align="start"
>
<Calendar
mode="single"
selected={dueDate}
onSelect={handleDateSelect}
aria-label="Calendar date picker"
/>
</PopoverContent>
</Popover>
{dueDate && (
<Button
type="button"
variant="ghost"
size="sm"
onClick={() => handleDateSelect(undefined)}
className="text-muted-foreground hover:text-foreground"
>
Clear date
</Button>
)}
</div>
<div className="flex justify-end gap-2 pt-4">
<Button
type="button"
className="cursor-pointer"
variant="outline"
onClick={handleClose}
disabled={isSubmitting}
>
Cancel
</Button>
<Button
type="submit"
className="cursor-pointer"
disabled={!title.trim() || isSubmitting}
>
{isSubmitting
? (isEditing ? "Updating..." : "Creating...")
: (isEditing ? "Update Task" : "Create Task")
}
</Button>
</div>
</form>
</DialogContent>
</Dialog> This was an error I had, and this solution worked for me. Hopefully, it helps you too |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
when I using a the drawer from shadcn, when i trigger the drawer using TriggerDrawer, then the state updates to true, But the error getting up and nothing happens.
For more info
I have started a vite react js project, by using tanstack start and that uses vinxi, along with tailwind and shadcn, Solve if possible.
Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at https://w3c.github.io/aria/#aria-hidden.
Element with focus: button:
These are some snaps of the configs
Beta Was this translation helpful? Give feedback.
All reactions