-
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
Persistent reordering of collection in Meteor not working #398
Comments
👍 |
I also get all items ending up with the same "order" value after sorting multiple times in the UI - any ideas? |
Just wondering if any ideas on how to solve this? Thanks |
Same problem here. I get the following error in the console: update failed: Access denied |
I have the same issue. All fields end up with the maximum value, as seen above. In my case, there are four documents that are being sorted and after the sort the order property is set to 4 in all of the documents. |
Like several others, my order values, which I manually initialized to be unique, eventually gravitate toward a single value. However, I'm not seeing an error in the Meteor console. Is anyone willing to tell me how I could work on the solution myself? I'm considering forking and publishing my own version to Atmosphere just so I can play with it...hidden w/ EDIT 1: I looked into using a local version so I could play around and debug, but Meteor doesn't seem to be honoring the EDIT 2: Just answering my own question here. My problem was that I was treating this repo, which (obviously) has multiple integrations in it (Angular, React, etc.) as if it was simply a Meteor package. In fact the Meteor package is only one subdirectory within the repo. There was a dependency on * The point being that I can now try to debug this sort order weirdness. ;-) Cheers! |
@day, did you have any luck? |
Up and down are relative. The assumption that the order of elements in the DOM will be congruent with the order of the sort is not correct when elements are displayed in descending order. With this change we now accommodate display of sortable elements in either ascending or descending order. (It's possible this is related to other issues with persistent reordering: SortableJS#398)
@jishaal: Yes. My experience was that with the sortable elements displayed in ascending order, the problem was intermittent and difficult (though not impossible) to reproduce; I could not formulate a reliable method for reproducing the problem. However, with the sortable elements displayed in descending order, the problem was consistent and could easily be reproduced. A reading of the code in the adjustOrders function revealed an underlying assumption that the order of elements in the DOM was in the same direction as the sort order (i.e. ascending order was assumed). The comments showed that elements were conceived of as moving "up" or "down" in the sort and the intervening elements were slated to have their order field incremented or decremented accordingly. All I did is reverse the order of the arguments in the event that elements were displayed in descending order. After I made that change, I could no longer reproduce the problem with either ascending or descending elements. I have not been able to wrap my head around why it may have effected the ascending case, since the code does exactly what it always did in that case...but that's my experience anyway. The problem is solved for me. Here's my commit; I've not yet made a PR: day@cc483ad |
@chiester & @FickleLife Any chance you guys were displaying your set in descending order? |
@day, thanks for the info! Much appreciated. |
@day you just saved me many many more hours, thanks! |
Up and down are relative. The assumption that the order of elements in the DOM will be congruent with the order of the sort is not correct when elements are displayed in descending order. With this change we now accommodate display of sortable elements in either ascending or descending order. (It's possible this is related to other issues with persistent reordering: RubaXa#398)
Dear all! Meteor is moved to the separate repository. If this issue is still actual, please create it there once again. For your info: this project needs a maintainer. |
When I reorder my lists in meteor, the order fields are all set to the same value after dragging-and-dropping the elements. The orders start out distinct, but after playing with the ordering on the client all of the order attributes are set to the same values.
This may be related to issue #287 or #197.
Original ordering:
After scrambling elements in UI:
Also, I'm getting this error in the meteor console when I reorder:
Any help with this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: