Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
zstoyanova9 opened this issue May 10, 2024 · 0 comments

Comments

@zstoyanova9
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant