telerik / kendo-angular

Issue tracker - Kendo UI for Angular
http://www.telerik.com/kendo-angular-ui/
Other
464 stars 213 forks source link

[Grid] Programmatically scrolling a Grid with virtual scrolling after updating its data with different number of items empties the component #4296

Open zstoyanova9 opened 2 months ago

zstoyanova9 commented 2 months ago

Describe the bug When trying to update the data of a Grid with virtual scrolling enabled to a new one with a different number of items, and then use the scrollTo() method to programmatically scroll the component, it is displayed as an empty Grid with no records.

To Reproduce

  1. Open the following StackBlitz example - https://stackblitz.com/edit/angular-1dooxc-ryvow4
  2. Scroll to the bottom of the Grid manually.
  3. Click the "Scroll to 0" button.

chrome_FX8d5h6Bs7

Expected behavior The Grid should not be displayed as empty and should be scrolled to the defined scroll position.

Workaround Execute the scrollTo() method in a setTimeout() function: setTimeout(() => { grid.scrollTo({row: 0, column: 0}); })

StackBlitz example with workaround: https://stackblitz.com/edit/angular-1dooxc-xh3gmt