Skip to content

item-reorder returning wrong indexes in some cases #8782

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

Closed
estyles opened this issue Oct 18, 2016 · 3 comments
Closed

item-reorder returning wrong indexes in some cases #8782

estyles opened this issue Oct 18, 2016 · 3 comments

Comments

@estyles
Copy link

estyles commented Oct 18, 2016

the (ionItemReorder) $event object returns the wrong 'to' index when dragging an item up or down, then while still dragging it, dropping it back to it's original place.

you would expect the 'from' and 'to' index to be the same value in this case, but instead it returns the 'from' index +1 or -1 depending on the last direction.

eg. dragging index 1 to index 3 then back up to index 1 and dropping it. will return, Object {from: 1, to: 2}
dragging index 3 to index 0 then back up to index 3 and dropping it. will return, Object {from: 3, to: 2}

you can also see the item is moved up or down while it should actually be remaining in place.
eg. when using ionics reorderArray(); function

Example,
http://plnkr.co/edit/590zKDfE071e63NYzhTK?p=preview

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS:
Node Version: v5.12.0

@jgw96
Copy link
Contributor

jgw96 commented Oct 19, 2016

Hello, thanks for using Ionic! I am going to close this as a duplicate of #7522.

@jgw96 jgw96 closed this as completed Oct 19, 2016
estyles pushed a commit to estyles/ionic that referenced this issue Oct 19, 2016
@estyles
Copy link
Author

estyles commented Oct 19, 2016

Hello, thanks for the reply, I dont think it is a duplicate, I think he is referring to the way animations on the list items don't always work. the two might be related but I doubt it.

I just fixed this bug by the way,
estyles@4c8bbdf

maybe you guys can figure out a better solution but this works great for me.

@estyles
Copy link
Author

estyles commented Oct 20, 2016

nvm.. it still doenst work, just replaced it with some other problems, I'll look into it further tomorrow.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants