igniteui-angular
igniteui-angular copied to clipboard
Grid Row selection removes parts of selection not found in current data) when [de-]selecting a new row
Description
When the data of the Grid is changes (consider all the remote use cases that leverage that mechanic), selection generally remains unchanged. However if the new data set does not contain some of the selected rows (by primary key), those are removed seemingly as the new selection is calculated. So something is not right
- igniteui-angular version: 16.0.16
- browser: N/A
Steps to reproduce
- Open https://stackblitz.com/edit/knucth-ekywge (forked from @pmoleri's sample)
- Select rows 1 and 7
- Click the Refresh Data button
- Inspect the current selection (7 should still be in
grid.selectedRows
) - Select row 3
- Inspect the current selection
Result
Starting with selection of [1,7]
with new data:
after selecting row 3 we end up with
[1,3]
and 7
is removed (presumably since it's no longer in the current grid data):
The event itself also doesn't include this as removed, so it's not like it was deselected for some reason, more like it's gone inexplicably
Expected result
If the selection of the grid is maintained through data changes (presumably for remote scenarios?), then parts of it shouldn't be dropped on the next selection operation by the user or should be cleared immediately with the data change, otherwise selectedRows
looks out-of-sync/broken.
The Row Selection (Grid feature) spec is quite outdated, so can't really count on it to dictate that behavior even if it actually did, so some digging to identify the reasoning of maintaining the selection through data changes might be needed. Almost certain some remote features that purely override strategies leave the grid blissfully unaware of the remote use so that probably justifies the keeping of selected rows until manually cleared. We could always consider enhancements if possible, but at least the state as it is now should be consistent.
Attachments
Attach a sample if available, and screenshots, if applicable.
There has been no recent activity and this issue has been marked inactive.
There has been no recent activity and this issue has been marked inactive.
There has been no recent activity and this issue has been marked inactive.
There has been no recent activity and this issue has been marked inactive.
There has been no recent activity and this issue has been marked inactive.