django-autocomplete-light
django-autocomplete-light copied to clipboard
Fix django-nested-admin dragging fields
Fixing an issue where dragging an inline admin section would initialize the autocomplete fields during the dragging phase and when dragging stopped the autocomplete field would be reset and not get initialized again since the internal initialized list would already contain that element.
To prevent this, added a check to the DOM listener logic to verify that the container element being added isn't the one used to represent the element while it is being dragged.
Before
https://user-images.githubusercontent.com/6753326/191374994-cdae0bb1-d244-447b-9417-2a062821e443.mov
After
https://user-images.githubusercontent.com/6753326/191375318-99a9cb2a-46e6-4fa3-a77e-b30f0ba68411.mov