-
-
Notifications
You must be signed in to change notification settings - Fork 182
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
[Bug]: SortAndBind
has different behaviour to .Sort().Bind()
#975
Comments
Closing this as it seems the issue is actually in TreeDataGrid, which does not support moving a selection atm |
I mean, if you were able to observe a difference in behavior between |
Correct! The issue was a small difference in the first and second test. I'm neck deep in debugging it now so if something else comes up I'll reopen/open a new ticket :) I actually figured out there was an error in my testing when I tried to modify the repro repo to better represent the issue. |
Godspeed. :) |
Ok, following up on the repro of this issue, it seems there IS a difference in how The issue is reproduced under this specific branch: https://github.com/giard-alexandre/TickingTdg/tree/repro/dd-sortandbind-selection If you go to this line in the viewmodel, you can comment out one or the other for testing. My findings are as follows: Preface
When using
|
`.Sort().Bind()` | `.SortAndBind` |
|
|
Again, hopefully I'm not doing something dratically wrong but, seems to me that these 2 operators should be returning the same information!
SortAndBind
has different behaviour to .Sort().Bind()
Just to confirm: this is using the SourceList and not SourceCache? Also, could this have been addressed by #939? |
It's using a SourceCache! |
Okay, so, implementation of I'll defer to @RolandPheasant for this one as well, he's done far more work with sorting implementations and operators than I have. |
Ah yes that makes sense, I guess I may have been a little too keen to move to SortAndBind for the efficiency gains. I'd be more than willing to look into getting a PR going for this if no one else has enough interest to look into but a little assistance to get pointed in the right direction would be extremely appreciated! 😄 |
I've just looked into this and I noticed it works and uses move instead remove and replace. Further investigation shows it was fixed here https://github.com/reactivemarbles/DynamicData/pull/936/files which has not yet been deployed. I think it's time to deploy a new version! |
Ah thank you! Good find! |
@giard-alexandre I have deployed v9.1.1 Can you upgrade to that and let me know if the issue is fixed? |
Confirmed that the new version does indeed fix this issue! Thanks again @RolandPheasant & @JakenVeina :) |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Describe the bug 🐞
I'm specifically calling this out on the Avalonia TreeDataGrid, but I suspect this will be true on any control that shows lists and allows selection, across any framework. I do not have this issue when using the old
.Sort(sorter).Bind(out list)
method of sorting, no matter what optimization options I pass intoSort
orSortAndBind
.Step to reproduce
TransformWithInlineUpdate
to update items inline.Sort().Bind()
.SortAndBind()
Reproduction repository
https://github.com/giard-alexandre/TickingTdg
Expected behavior
Selection should be preserved when we update items inline.
Screenshots 🖼️
No response
IDE
No response
Operating system
No response
Version
No response
Device
No response
DynamicData Version
9.0.4
Additional information ℹ️
No response
The text was updated successfully, but these errors were encountered: