Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dragging/dropping is laggy on slower computers when using the dragOver event #39

Open
DBosley opened this issue May 27, 2016 · 2 comments

Comments

@DBosley
Copy link

DBosley commented May 27, 2016

If a function is called on the 'dragOver' event, depending on the function's complexity, it can make slower computers very laggy while dragging.

If there was a way to reduce the speed at which this executes, that would help a lot for performance.

@papandreou
Copy link
Contributor

You mean some kind of throttling/debouncing of the function itself? Maybe something like https://remysharp.com/2010/07/21/throttling-function-calls could be used so we wouldn't need to build it into knockout-dragdrop?

@DBosley
Copy link
Author

DBosley commented Jun 22, 2016

I was able to use underscore.js's _.throttle method to get the performance increased. This had some side effects (like if you let go before it would let the 'dragOver' event function execute) but they were pretty simple to resolve. It all works fantastically now, but built in throttling might be a good idea to keep in mind for feature enhancements. Especially if you could guarantee the first execution of the function call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants