ui
ui copied to clipboard
[bug]: How to change HTML tag for AccordionTrigger to a div, so that buttons can be nested.
Describe the bug
I'm trying to nest buttons inside of the AccordionTrigger to trigger popovers with useful information to my users. By default, AccordionTrigger is an 'HTMLButtonElement'. Is there any way to change this to a 'div' that has an onClick event, while still controlling the open and close state of the Accordion? I'm asking to avoid the attached console error.
Affected component/components
Accordion, AccordionTrigger
How to reproduce
Nest a 'Button' element as a child of 'AccordionTrigger'
Codesandbox/StackBlitz link
No response
Logs
No response
System Info
Using MacOS, Brave Browser
Before submitting
- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
same issue for me aswell
i change inside button to span with buttonVariants
<span className={cn(buttonVariants({ variant: "outline", size: "icon" }), "size-5 rounded-none shadow-none mr-1")}>
<Plus className="size-4 text-accent-foreground/50" onClick={() => alert("ok")} />
</span>