bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
22.08k stars 1.97k forks source link

Dragging outside the boundary causes error accessing attribute on a null object #709

Open ayushkamadji opened 5 months ago

ayushkamadji commented 5 months ago

With a drag zone that overflows the browser window, when dragging an item outside the browser window, errors will appear on the console because using doc.elementFromPoint returns null. MDN doc of elementFromPoint

https://github.com/bevacqua/dragula/blob/09ab978dd550490f1f8e456551a1a39ed0d7f984/dist/dragula.js#L170-L177

and this line tries to access tagName attribute on that null object. https://github.com/bevacqua/dragula/blob/09ab978dd550490f1f8e456551a1a39ed0d7f984/dist/dragula.js#L604

https://github.com/bevacqua/dragula/assets/8255357/72e988cb-b170-4c25-b445-f9c011d888f3

=== Dragula version: 3.7.3

Please only use GitHub issues for bug reports and feature requests.