huboard / huboard-web

GitHub issues made awesome
https://huboard.com
61 stars 26 forks source link

Card disappearing on reorder #341

Closed discorick closed 8 years ago

discorick commented 8 years ago

Ran into a case where a care disappears on every move, then reappears when a render is forced on on the milestones view:

uhoh

The card below meta-data (test-issue#7) image

The card above meta-data (test-issue#6) image

The meta-data of the card being moved: image

discorick commented 8 years ago

This explains the behavior: https://github.com/huboard/huboard-web/blob/master/ember-app/app/mixins/cards/card-move.js#L21

I created all these issues from the task-view, for some reason they were all assigned the exact same milestone_order key values.

dahlbyk commented 8 years ago

I'm unclear why this would cause the card to disappear, vs simply failing to reorder (or having nondeterministic order among the three with identical milestone_order values).

discorick commented 8 years ago

So, to keep glimmer from loosing track of cards in the DOM sortable list - we are actually pulling the issue object out of a computed array. You can see here https://github.com/huboard/huboard-web/blob/master/ember-app/app/components/columns/hb-column.js#L14

It seems in this case (maybe because there is no change to the underlying data) the computed list is not rebuilding, which means the card is never placed back into the DOM.