Closed droska closed 3 years ago
While my response is very delayed, I thought I would include a solution here for anyone who needs this type of functionality.
You can essentially watch the onChange
function and if the length of the new selected
values is greater than the previous state, then you know that items have move to the right. Otherwise, they have moved to the left:
onChange(newSelected, targetItems) {
const { selected: oldSelected } = this.state;
const movedRight = newSelected.length > oldSelected.length;
if (movedRight) {
// Do something
} else {
// Do something else
}
}
Hello, great work! i'm using your awesome library, and i'm trying to call a POST request when an item is selected to go right and call a different POST request when an item is selected to go left.
There is any function that can help me to do this?
Thank you very much!