vue-drag-drop
vue-drag-drop copied to clipboard
Noisy drag events
While dragging, the Drag component seems to emit a drag event every couple of milliseconds. This swamps the event view in my DevTools (to the point of hanging up my DevTools).
Would be really handy if there was a way of suppressing unwanted events.
This is the standard way the spec operates:
The drag event is fired every few hundred milliseconds as an element or text selection is being dragged by the user.
I don't think an option to suppress certain events is a good addition to the API, since it pretty sharply goes against the way the web operates (and I'm not even sure if it's possible). If you don't wish to respond to an event, you simply don't listen for it.
For that reason I'm going to close this, but if you have further arguments in favor of the feature, or a specific suggestion for how to modify the API to support it, I'm not opposed to reopening.
Having given this some more thought, I realized I closed this too hastily. Will look into it.
Yay :) I had a quick look at the source and I think I can see a reasonably elegant way of doing it. Happy to have a bash and make you a PR if you like?
By all means. I already took a crack adding a milliseconds debounce prop, and using the debounce package to slow the event emission, but it was behaving strangely. Maybe you'll have more luck.
Also, you'll want to PR into the release/1.0.0 branch. It should be easier to work in, since the code is simplified.
Is this abandoned?
I have the same issue 😞 @pdcmoreira Did you find a temporary solution?
@AMoreaux no, it's just a bit annoying when debugging, but everything else is fine.