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

FIX: Sorting does not work when there are many items #693

Merged

Conversation

akashgp09
Copy link
Contributor

@akashgp09 akashgp09 commented Aug 25, 2021

Problem

Sorting isn't working as expected and undesirable results are observed when there are more than 8 items in the series.

Cause:

When an object is saved to the redux store in this order: { n3: { ... }, n2: { ... }, n1: { ... } } and when retrieved back, it is returned in a sorted form by default { n1 { ... }, n2: { ... }, n3: { ... } }

Additionally, position value is unnecessarily updated inside handleNumberAttributeChange event handler, which leads to inappropriate results in the case of manual ordering type.

Solution

  • We need to sort the items in the frontend here, once the object is converted to an array.
  • Removed attributePosition from handleNumberAttributeChange event handler.

@MonkeyDo MonkeyDo merged commit 7628fa8 into metabrainz:series-entity Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants