-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Reset "newIndex" value when dragging element between lists. #488
Comments
Fixed: http://codepen.io/anon/pen/QbJyER |
The pen works great. Thanks. But in my code sometimes I'm having the following error:
It happens randomly when I drag the new element at the end of the list, but it happens mostly when I drag new element in between. Maybe is a bug in my code. I will try to double check it. Thanks again for you help :) |
Fixed. Try again dev-branch. |
Working like a charm! And I'm sure you already know this, but just in case, I have this non related error:
Thanks a lot for your help :) |
@srosengren ⬆️ ⬆️ ⬆️ ? |
I'm not sure if there is another way to do this, but my problem is the following:
I have two lists A and B, and I want to drag an element from list A to list B. First time I drag inside list B an element from list A, the
newIndex
value is set to the position value where I have dropped the list A element on list B, but, if then I drag a new element from list A but I drop it outside list B, thenewIndex
value is not set again toundefined
. Instead, it keeps the value of the last successful drop inside list B. Is there any way to setnewIndex
toundefined
everytime I start a new drag from list A?What I need is to know if I drop the element from list A inside list B or everywhere else inside the page to warn the user with an alert to drop the element in the right place.
Example in CodePen
Try to drag an element from green list to white space between lists. Then try again but now from green list to blue list, and again from green list to white space. The
newIndex
value remains instead of beingundefined
.The text was updated successfully, but these errors were encountered: