React-sortable-hoc: Button inside SortableContainer.

Created on 24 Jan 2020  路  4Comments  路  Source: clauderic/react-sortable-hoc

Is it possible to allow button to click inside SortableContainer? like I have a list of products which can be sorted. but the button inside div should be clickable as I'm opening popover of tags of that particular product.

Most helpful comment

@walid-mokrani I've set
distance={1}
And it worked. this means we needs to slightly move the element to start sorting. clicking on any element before that will work as expected.

All 4 comments

Just use shouldCancelStart prop on the SortableContainer and return true when the event target is of type button or whatever

@walid-mokrani
Show me example used shouldCancelStart?

@walid-mokrani I've set
distance={1}
And it worked. this means we needs to slightly move the element to start sorting. clicking on any element before that will work as expected.

@ashishtechuz you rock !

Was this page helpful?
0 / 5 - 0 ratings