Skip to content

Commit

Permalink
Fix multiple lists optimistic sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
clauderic committed Sep 23, 2024
1 parent 5b36f8f commit 1ca6882
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,11 @@ export function MultipleLists({
return;
}

event.preventDefault();
if (target.id === source.data.group) {
event.preventDefault();
return;
}

setItems((items) => move(items, source, target));
}}
onDragEnd={(event) => {
Expand Down Expand Up @@ -164,13 +168,15 @@ function SortableItem({
style,
onRemove,
}: PropsWithChildren<SortableItemProps>) {
const group = column;
const {handleRef, ref, isDragSource} = useSortable({
id,
group: column,
group,
accept: 'item',
type: 'item',
feedback: 'clone',
index,
data: {group},
});

return (
Expand Down

0 comments on commit 1ca6882

Please sign in to comment.