You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.
I've been working for a while on this case and it has just been giving me hardcore headaches so here is what I just founded.
I've got some objects in my list (looking like this) :
Here is the content binded with ng-model :
The thing is that when I am trying to swap the card 2 with the card 0, the result I see is not what I am expecting :
In fact, we'll see that card 2 is nicely ordered but we see that card 0 is taking the place of card 1 in the list instead of picking old's card 2 place (at the end).
So here's my question : is that the normal behaviour or is it a real ordering problem ?
Sorry for my poor English, I hope i was clear.
EDIT : After doing some more research and checking in codepens, I think it's the right behaviour. Is it possible to add an option to swap items in the sortableOption instead of reordering them ?
The text was updated successfully, but these errors were encountered:
This is the expected behavior, regardless from the orientation of the list.
The primary use case of jquery-ui-sortable (and as a result, this wrapper
library as well) is to move one element before an other one (not swapping)
and move all the respective in between elements.
In your example specifically, card 2 was moved before card 0 and as a
result cards 0 and 1 were pushed to the respective next position.
You can probably achieve the swapping use car you described by adding some
code in the stop callback and using the properties available on the
ui.item.sortable object (where ui is the second parameter of the callback).
Take a look at readme.md and api.md .
Just saw your edit.
I would prefer not to add features the extend the functionality that
jquery-ui-sortable offers, so that this library can be both lightweight,
not interfere with the jquery-ui lib and also offer the same degree of
extensibility/customization.
For such use cases I prefer just adding a codepen example in README.md (PRs
Hello,
I've been working for a while on this case and it has just been giving me hardcore headaches so here is what I just founded.
I've got some objects in my list (looking like this) :
Here is the content binded with ng-model :
The thing is that when I am trying to swap the card 2 with the card 0, the result I see is not what I am expecting :
In fact, we'll see that card 2 is nicely ordered but we see that card 0 is taking the place of card 1 in the list instead of picking old's card 2 place (at the end).
So here's my question : is that the normal behaviour or is it a real ordering problem ?
Sorry for my poor English, I hope i was clear.
EDIT : After doing some more research and checking in codepens, I think it's the right behaviour. Is it possible to add an option to swap items in the sortableOption instead of reordering them ?
The text was updated successfully, but these errors were encountered: