telerik / kendo-react

Issue tracker - KendoReact http://www.telerik.com/kendo-react-ui/
https://kendo-react-teal.vercel.app
Other
209 stars 37 forks source link

Grid with Groups, Virtual Scrolling and Selection does not function properly #2288

Open helm100 opened 1 month ago

helm100 commented 1 month ago

I'm submitting a Feature request/Bug report

Similar issue: https://github.com/telerik/kendo-react/issues/1535

Current behavior

In a grid where virtual scrolling is enabled along with grouping, the GridSelectionChangeEvent contains faulty data.

Expected behavior

I expect the GridSelectionChangeEvent to point to the actual DataItem that was clicked

Minimal reproduction of the problem with instructions

Starting point: https://www.telerik.com/kendo-react-ui/components/grid/scroll-modes/virtual/#toc-using-virtualization-with-grouping The bug is observable in this minimal working example: https://codesandbox.io/p/sandbox/zen-tree-mlp4pg Different rows are selected than the one that was clicked (for each group, the index is increased by 1).

What is the motivation or use case for changing the behavior?

I would like to be able to execute custom actions when a user clicks a row in a virtual grid. The action should depend on the actual field (row + column) that was clicked by the user.

Environment

Package versions: 8.0.0

Browser:

iadnonov commented 1 month ago

Hello @helm100 ,

Thank you for reaching out to us. This is a known issue, and it is logged in our public repository https://github.com/telerik/kendo-react/issues/1535. Our team will do their best to fix it and when we have any progress on the fix, we will update the issue.

Please excuse us for any inconvenience caused and if we can assist you with anything else, do not hesitate to submit a ticket in our support system.

Cheers, Ivaylo

WissamProgress commented 4 weeks ago

It is a regression between versions 7.3.0 and 7.4.0 for the Grid and is specific to using grouping, selection, and virtualization.

For 7.3.0 it was working - https://stackblitz.com/edit/react-kenryc-hgt7wj?file=package.json

For 7.4.0 it stopped working - https://stackblitz.com/edit/react-kenryc-amrqfp?file=package.json

iadnonov commented 2 weeks ago

Fixed in dev version 8.1.0-develop.19.

helm100 commented 2 weeks ago

I tried it out and it still doesn't show correct behavior:

  1. I forked https://stackblitz.com/edit/react-kenryc-amrqfp?file=package.json
  2. Changed Kendo packages to 8.1.0-develop.19
  3. Scrolled all the way down in the grid
  4. Clicked rows; other rows got selected
WissamProgress commented 1 week ago

Same is the case with checkbox selection when combined with virtual scroll. The onSelectionChange event returns an incorrect row index, resulting in the selection of a different row.

https://stackblitz.com/edit/react-nigr7r?file=app%2Fapp.tsx,app%2Fshared-gd-products.json

Ticket ID: 1656732

iadnonov commented 5 days ago

After further investigation and consulting with the team, I am changing the issue to a feature request. The reason is that the combination of virtual scrolling with grouting and selection is not a supported combination with the current KendoReact Grid implementation and needs additional changes to achieve this scenario. The previously provided fix is unable to resolve the issue and cannot be considered a regression.

Please excuse us for any inconvenience caused and when we have any progress, we will update the issue.