StreakYC / react-draggable-list

React component for a list of draggable collapsible items
MIT License
319 stars 48 forks source link

add onItemClick prop #56

Closed sbbu closed 4 months ago

sbbu commented 1 year ago

onItemClick is an optional function which is called once a list item is clicked or touched. It provides clickedItem: Object as an argument. Use this prop if you want the user to be able to select some item in the list and run custom logic with that item, regardless of if it is dragged.

Macil commented 4 months ago

In version 4.2.0, I've added an item parameter to the onDragStart prop (and the onDragEnd prop) which can be used in place of this. The new onItemClick prop seemed redundant after that.