vue-drag-drop icon indicating copy to clipboard operation
vue-drag-drop copied to clipboard

Noisy drag events

Open ckritzinger opened this issue 7 years ago • 7 comments

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.

ckritzinger avatar Feb 05 '18 08:02 ckritzinger

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.

cameronhimself avatar Feb 06 '18 01:02 cameronhimself

Having given this some more thought, I realized I closed this too hastily. Will look into it.

cameronhimself avatar Feb 09 '18 04:02 cameronhimself

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?

ckritzinger avatar Feb 09 '18 07:02 ckritzinger

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.

cameronhimself avatar Feb 09 '18 14:02 cameronhimself

Is this abandoned?

pdcmoreira avatar Jan 10 '19 19:01 pdcmoreira

I have the same issue 😞 @pdcmoreira Did you find a temporary solution?

AMoreaux avatar Jan 14 '19 13:01 AMoreaux

@AMoreaux no, it's just a bit annoying when debugging, but everything else is fine.

pdcmoreira avatar Jan 14 '19 14:01 pdcmoreira