Restrict node drop action in some groups

In my application, I have let’s say 100 nodes. Out of those 100, I have requirement that 50 nodes can be dropped in Group A ONLY, and the remaining 50 nodes can be dropped in Group B ONLY.

So I want to restrict the dropping of nodes in wrong groups. How can I achieve this?

I have implemented memberValidation function but it’s not helping me. Even though I return false from memberValidation function it still adds node to the group.

So you have checked that your memberValidation predicate is returning the correct true and false values?

Well, here is a sample that demonstrates what I think you are looking for, and also tests the effectiveness of member validation when dragging in from another Diagram as well as within a Diagram:
https://gojs.net/extras/addToGroup.html