react-sortable-list
react-sortable-list copied to clipboard
onClick is not working inside SortableList
trafficstars
My code is
<SortableList
items={navItem}
setItems={setNavItem}
itemRender={({ item }) => (
<div>
<button
className={'w-[365px] mb-8 p-2 rounded-lg border'}
onClick={() =>
screenSize <= 768 && selectedTab === item.id
? setSelectedTab("")
: setSelectedTab(item.id)
}
>
{item.label}
</button>
</div>
)}/>
if I want to do somthing by onClick event, onClick is not working here.
I think I have a similar issue here, I have an input in the list but when I tried to click on it and type, it gave me this error
The dragging function works fine tho
@Joyontokarmakar @JeffreyLee-Pricer It will take some time to fix this issue. A temporary solution is to use DragHandler to separate drag and click events. Example code:
https://github.com/ThaddeusJiang/react-sortable-list/issues/7#issuecomment-1537885508