Hello,
I'm trying to get client side virtual scrolling working in a multiselect with kendo-dropdowns-react-wrapper.
I have a multiselect containing a list of items (people) belonging to a group. The datasource is changing dynamically, according to the group selection in another dropdown list.
The same person may belong to different groups, but the groups may contain different people.
When I change the group selection, if a person is selected which belongs to both groups, I'd like the related multiselect item to remain selected.
This expected behavoiur works well with virtualization disabled, but when I enable virtualization I experience a strange behaviour.
Despite I have implemented the valueMapper function (that is called correctly and returns the correct new index list), when changing the datasource, the selected indices are not updated and the new items corresponding to the old indices are selected.
What am I missing to get it work with virtualization?
Below are the stackblitz examples.
To reproduce the problem:
- initially select "Clare Kline" and "Hamilton Holland" (the names are imaginary and created with a random generator) from the multiselect (records 1 and 3)
- Switch from "group 1" to "group 2" in the dropdownlist
- Verify that the multiselect selection has changed to "Hamilton Holland" only (who is the only person in common between the two groups): this works in non-virtualized version, while in the virtualized version "test2" and "test3" are selected.
- Select "group 1" again in the dropdownlist
- Verify that "Clare Kline" and "Hamilton Holland" are selected again
Without virtual scrolling: https://stackblitz.com/edit/react-ts-fnfdar?file=index.tsx
With virtual scrolling; https://stackblitz.com/edit/react-ts-qb16wa?file=index.tsx