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

Drop works even if dropAllowed returns false #23

Open
v1r0x opened this issue Nov 18, 2019 · 1 comment
Open

Drop works even if dropAllowed returns false #23

v1r0x opened this issue Nov 18, 2019 · 1 comment
Labels

Comments

@v1r0x
Copy link
Contributor

v1r0x commented Nov 18, 2019

Version(if relevant): 5.8.x

I really like how this plugin has evolved over time! 🎉

We recently started a large project inside our software using the plugin.
This leeds to two problems which overstrains the local machine

  1. Hovering over an item opens it instantly (see other issue)
  2. Our logic for dropAllowed() is rather complex and takes a couple of ms to compute. And we also have to re-check it in the drop event, even if the drop indicator is red (drop not allowed)

Is it possible to not execute the drop event if drop is not allowed? Or is this already possible?

I'm not sure if this is already the case, but when hovering over a (large) set of items the dropAllowed() is computed for each item hovered.
For 50 items on the same level I hovered to get down to the item I actually want to hover and drop the dragged item on it, the dropAllowed() check is executed 50 times.
Is this already cancelled when another item is hovered (or an item is no longer hovered)? This would save us a lot of time and computations.

@plantain-00
Copy link
Owner

It seems debouncing or throttling can also solve this: https://css-tricks.com/debouncing-throttling-explained-examples/

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

No branches or pull requests

2 participants