Open minhsu12113 opened 5 days ago
For anyone facing same issue as I am, you can use input type checkbox instead of button. You might want to re-style the input as needed.
<div className='flex items-center gap-2 w-full'>
<input
type='checkbox'
className='rounded-sm w-4 h-4 focus:ring-primary text-primary dark:focus:ring-primary dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600' />
<span className='flex-grow text-sm truncate'>{item.name}</span>
</div>
Describe the bug
I creating tree compoent with checkbox like the below image
That component reference: https://github.com/shadcn-ui/ui/issues/355#issuecomment-1703767574
I'm notice if I put the Checkbox inside Tree item then I get error: validateDOMNesting(...):
Affected component/components
CheckBox
How to reproduce
Codesandbox/StackBlitz link
No response
Logs
System Info
Before submitting