reppners / ngx-drag-drop

Angular directives using the native HTML Drag And Drop API
https://reppners.github.io/ngx-drag-drop/
BSD 3-Clause "New" or "Revised" License
307 stars 120 forks source link

dndDragover class doesn't always go away when moved away from dropzone #134

Closed mmestas closed 1 year ago

mmestas commented 1 year ago

Describe the bug Specifically when using the nested dropzones and rolling over a dropzone, the class ".dndDragover" is added to the element. What I noticed is it sometimes/often does not go away and keeps adding this class to other dropzones as well without removing the class from the other dropzones, even thought it's no longer being dragged over.

This happens regardless of how I have the nesting - whether the dropzone is on the surrounding div, or on the inner div

To Reproduce I don't have a stackblitz, but if it's really necessary, I can try and create one

Steps to reproduce the behavior:

  1. Create a nested list

  2. create a class to more easily see the effect .dndDragover { background-color: green !important; }

  3. Attempt to drag the item into one of the nested dropzones, but don't drop it. Roll over multiple nested dropzones. You will see the background color stays. Upon using the browser's webtools, inspect each item and you will see that the class "dndDragover" is on each of these items and has not gone away even though they are no longer having the item dragged over them. Sometimes they clear out, sometimes they don't.

Expected behavior "dndDragover" class should only appear/be added on the one, individual dropzone element it's being dragged over, and not on multiple at once. The previous classes should clear out and be removed from those elements in the DOM.

ChristofFritz commented 1 year ago

I have some time tomorrow and will look into this. Seems similar to #132

ChristofFritz commented 1 year ago

Sorry that it took so long, but it should be fixed now.