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

Reordering nested list #1480

Closed
cgarnier opened this issue May 23, 2014 · 13 comments
Closed

Reordering nested list #1480

cgarnier opened this issue May 23, 2014 · 13 comments
Assignees

Comments

@cgarnier
Copy link

When you put a ion-list in an ion-item (which is in a other list). The reorodoring have a bad behavior. The most inner items position is calculated with the main list, so the dragging item have a wrong position.

@perrygovier
Copy link
Contributor

Hey cgarnier, can you reproduce this in an example we can see and tinker around in, something like codepen.io?

@cgarnier
Copy link
Author

Hey perry! Here a codepen.

http://codepen.io/cgarnier/pen/bjhdk

You can see that when you try to reorder, the moving item is not under te cursor. The shift seams to be the number of items above.

@cgarnier
Copy link
Author

Ok i found a way to make it work. But it s not clean. The bugs are there:

  • In ListView.startDrag():
this._dragOp = new ReorderDrag({
            listEl: _this.el,

            el: item,
            scrollEl: this.scrollEl,
            scrollView: this.scrollView,
            onReorder: function(el, start, end) {
              _this.onReorder && _this.onReorder(el, start, end);
            }
          });

listEl is not the correct list. (You can get the good one by browsing parents and choose the first list)

  • In ReorderDrag._moveElement()
    Y position is not calculated in relative of container.

I fixed with:

    var y = e.gesture.center.pageY +
      this.scrollView.getValues().top -
      (this._currentDrag.elementHeight / 2)  - this.listEl.getBoundingClientRect().top;

But it's ugly.

  • The others "cloned moving items" of others list appears and should not.

@perrygovier
Copy link
Contributor

Ahh, thanks for the example. I see what you're talking about. Feel free to submit a pull request, or we'll take a look at it soon.

@perrygovier
Copy link
Contributor

Note that I thought #1583 was related, but afdf0ad apparently doesn't fix this.

@Ionitron
Copy link
Collaborator

Greetings!

Due to this issue's age and inactivity, it has been closed.

If you are still experiencing this issue, please feel free to reopen it so we may assist you.
If you wish to get help using the framework itself, the recommended place is the forum.

Thank you for allowing me to assist you.

@Eram90
Copy link

Eram90 commented Mar 18, 2016

Hi, does this problem have working solution ? I have the same problem, but I can't fix it...

@cgarnier
Copy link
Author

It s a beta6 issue. It doesnt been fixed yet ?

I dont remenber but i think the fix i proposed below was working.
But for sure i just stop try to nest the lists. Just make only one big list.

@Eram90
Copy link

Eram90 commented Mar 18, 2016

No, I still have that problem with ionic 1.7.14.

@cgarnier
Copy link
Author

@perrygovier may be you could re open this issue.

@Kinzi
Copy link

Kinzi commented Jul 22, 2016

@perrygovier I'm also interested in this - could you reopen?

@radvansky-tomas
Copy link

Same here, I have troubles to reoder nested list

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 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

7 participants