react-sortable-list icon indicating copy to clipboard operation
react-sortable-list copied to clipboard

onClick is not working inside SortableList

Open Joyontokarmakar opened this issue 2 years ago • 2 comments
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.

Joyontokarmakar avatar Jul 08 '23 11:07 Joyontokarmakar

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 image

The dragging function works fine tho

JeffreyLee-Pricer avatar Feb 20 '24 07:02 JeffreyLee-Pricer

@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

ThaddeusJiang avatar Oct 09 '24 06:10 ThaddeusJiang