You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
function onChange(sourceId, sourceIndex, targetIndex, targetId) {
if (targetId) {
const result = move(
tileState[sourceId],
tileState[targetId],
sourceIndex,
targetIndex
);
return setTileState({
...tileState,
[sourceId]: result[0],
[targetId]: result[1]
});
}
const result = swap(tileState[sourceId], sourceIndex, targetIndex);
return setTileState({
...tileState,
[sourceId]: result
});
}
Here is my current onChange function and it works, but I want it to always put the item at the end when dragged rather than swapping with an element it collides with while dragged when released like it currently does. How would I write that?
The text was updated successfully, but these errors were encountered:
Here is my current onChange function and it works, but I want it to always put the item at the end when dragged rather than swapping with an element it collides with while dragged when released like it currently does. How would I write that?
The text was updated successfully, but these errors were encountered: