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

After change of comparator @index in view stays the same for elements #1962

Closed
whitecolor opened this Issue Oct 1, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@whitecolor
Contributor

whitecolor commented Oct 1, 2015

After change of comparator on the list - @index value in view stays the same for sorted elements:

1. 700
2. 800
3. 300

after sort (using chage of comparator value I get:

3. 300
1. 700
2. 800

Is it a feature or a bug?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Oct 1, 2015

Contributor

Bug

Sent from my iPhone

On Oct 1, 2015, at 8:04 AM, Alex notifications@github.com wrote:

After change of comparator on the list @index in view does not change:

  1. 700
  2. 800
  3. 300
    after sort (using chage of comparator value I get:
  4. 300
  5. 700
  6. 800
    Is it a feature or a bug?


Reply to this email directly or view it on GitHub.

Contributor

justinbmeyer commented Oct 1, 2015

Bug

Sent from my iPhone

On Oct 1, 2015, at 8:04 AM, Alex notifications@github.com wrote:

After change of comparator on the list @index in view does not change:

  1. 700
  2. 800
  3. 300
    after sort (using chage of comparator value I get:
  4. 300
  5. 700
  6. 800
    Is it a feature or a bug?


Reply to this email directly or view it on GitHub.

@justinbmeyer justinbmeyer added the bug label Oct 29, 2015

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Oct 29, 2015

Contributor

@akagomez Any thoughts on this? Does a change of the comparator only issue "move" events? If so, are they getting their computeIndex updated?

Contributor

justinbmeyer commented Oct 29, 2015

@akagomez Any thoughts on this? Does a change of the comparator only issue "move" events? If so, are they getting their computeIndex updated?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Oct 29, 2015

Contributor

It doesn't look like indexMap is updated. An example of it being updated in add:

https://github.com/bitovi/canjs/blob/master/view/live/live.js#L285

Remove does something similar.

This needs to happen in move.

Contributor

justinbmeyer commented Oct 29, 2015

It doesn't look like indexMap is updated. An example of it being updated in add:

https://github.com/bitovi/canjs/blob/master/view/live/live.js#L285

Remove does something similar.

This needs to happen in move.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment