is there some way in angular material to prevent duplicate items in drop list? here is example code
https://stackblitz.com/edit/angular-xjex4y-43l7uh
I try to check if the item already exists in an array with event.currentIndex
but this is not correct, because, sometimes I get the wrong value.
event.container.data.included(event.container.data[event.currentIndex])
In stackblitz i need to use .indexOf() insead od .included(), because something not working
You can check current item using
previousIndex
and check if item already exist or not if exist then return likeworking demo