ember-table
ember-table copied to clipboard
restoring selection when rows are "new" does not behave as expected
I am revisiting #624 as I have found a valid case where this is a problem. If you implement a search combined with the selection behavior, selections will not restore properly. I think this stems from the equality check done by `isGroupSelection. To see this reproduced,
-
git clone --branch=topic-ember-table-bug [email protected]:efx/poc-bug.git -
npm install, ember serve
-
select a couple rows

-
search for a nonsense name value
-
clear the search value
-
you should see your selections are gone
I think this is from setting the rows to a new array of objects. I would expect my selections to be restored as the values are essentially equal even if the JavaScript data structures equality is falsey. Additionally, the selection property contains duplicate rows after these steps.
@gwak you may find this pertinent.
the `selection property contains duplicate rows after these steps
I think this results from using Set to store the objects. The equality checks will always return different.
I can fix this by substituting an identity function here. This seems like a feature, so I'll defer to discussion before opening a PR. You can find me on ember discord as well.