chanced / filedrop-svelte

File dropzone for Svelte.
MIT License
109 stars 12 forks source link

Fixed dragEnter and dragLeave being fired on child elements #10

Closed IsAvaible closed 1 year ago

IsAvaible commented 2 years ago

This is a solution for Issue 6, that works by keeping track of the number of times dragEnter and dragLeave were fired, and only dispatches an event when the counter reaches zero (implementing https://stackoverflow.com/a/21002544).

chanced commented 2 years ago

awesome, thanks! I'll look it over sometime this week. Hopefully tomorrow but my schedule is slammed at the moment.

The fact that I never got around to writing tests for this package is catching up with me.

nemzyx commented 1 year ago

Can i contribute to this repo by implementing the fix? Right now i have the implementation in my codebase, but it would be awesome if it was a part of the package

Edit: hmm realizing, maybe it's better to actually leave the events as is, for less opinionation