igniteui-angular icon indicating copy to clipboard operation
igniteui-angular copied to clipboard

Grid Row selection removes parts of selection not found in current data) when [de-]selecting a new row

Open damyanpetev opened this issue 1 year ago • 4 comments

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

  1. Open https://stackblitz.com/edit/knucth-ekywge (forked from @pmoleri's sample)
  2. Select rows 1 and 7
  3. Click the Refresh Data button
  4. Inspect the current selection (7 should still be in grid.selectedRows)
  5. Select row 3
  6. Inspect the current selection

Result

Starting with selection of [1,7] with new data: image 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): image 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 image

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.

damyanpetev avatar Aug 14 '23 15:08 damyanpetev

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Oct 31 '23 00:10 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Feb 03 '24 00:02 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Apr 08 '24 00:04 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Jun 08 '24 00:06 github-actions[bot]

There has been no recent activity and this issue has been marked inactive.

github-actions[bot] avatar Aug 11 '24 00:08 github-actions[bot]