Skip to content

Instantly share code, notes, and snippets.

@kagklis
Created February 6, 2022 13:29
Show Gist options
  • Save kagklis/8e6fba5a9e91f33123787d4956b28f03 to your computer and use it in GitHub Desktop.
Save kagklis/8e6fba5a9e91f33123787d4956b28f03 to your computer and use it in GitHub Desktop.
public dropped(event: CdkDragDrop<Item[], Item[], Item>) {
// VirtualScrolling and CdkDropList don’t work well together.
// Workaround solution: set the correct previousIndex manually.
event.previousIndex = event.previousContainer.data.findIndex(
(item) => item.id === event.item.data.id
);
// ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment