vue-smooth-dnd
vue-smooth-dnd copied to clipboard
Disable drop after certian item?
Hi, I have a list of draggable items which can be partially and temporarily disabled for any manipulations.
Let's say there is a list of 10 items and first 6 are enabled while the rest 4 are disabled.
Is there a way to prevent user from dropping the "enabled" item to any item among those 4 (basically to any position after index 6 in this case)?
I guess should-accept-drop can be used for that but I can't really see how to apply it for this use case.
Any advice is much appreciated.
Add a counter in your component and in onDrop increase the counter. Check if the counter reached the limit in should-accept-drop and return false when needed.
@Cmacu I mean, should-accept-drop seem to evaluate at the beginning of drag and not at the end.
I guess my question is - what is the API that can disable drop for a single item inside a container at the end of drag?
@Cmacu I mean, should-accept-drop seem to evaluate at the beginning of drag and not at the end.
I guess my question is - what is the API that can disable drop for a single item inside a container at the end of drag?
Have you solved your problem yet
@dgf957492430 nope...