Drag n Drop API not working as expected

I am working on a project on which user will drag a text from webpart(e.g. webpart1) & dropping the same text into other webpart(e.g. webpart2) . I am referring This link as reference . Based on below 2 scenarios I need to remove/retain list item from drag-able list.

  1. If user drags the list item on to same webpart drop container , item must be retained as it is .
  2. If user drags list item from webpart 1 and drops to webpart 2 , that item must get removed from list of webpart 1.

With the current implementation , if we drag the bottom last list item on itself , that item is getting removed from list .

Any kind of suggestion will be helpful .