Skip to content

Conversation

mshabarov
Copy link
Contributor

Description

When the grid web-component is used with Flow Grid component with the undefined lazy loading,
grid's size change leads to scroller jump to 0 index (iron list specifics).
It causes as many pages requested from backend, as the current page is.
E.g. if the page is 20, then the requested items range would be about 1000 items.
And the requested items count increases as grid is being scrolled further.

This issue is also observed within fast scroll, so the number of requested pages increases significantly.
With this fix, if the pending pages count is too much and the current requested page is far away of pending page range,
this page request will be ignored and the data provider wouldn't be called.

Type of change

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

Additional for Feature type of change

  • Enhancement / new feature was discussed in a corresponding GitHub issue and Acceptance Criteria were created.

@tomivirkki
Copy link
Member

tomivirkki commented Oct 8, 2021

I wonder if this could be fixed in the virtualizer instead. When the size gets changed, we could prevent the virtualizer from requesting updates to elements until the size change logic has finished restoring the original scroll position.

@mshabarov
Copy link
Contributor Author

I wonder if this could be fixed in the virtualizer instead. When the size gets changed, we could prevent the virtualizer from requesting an update to element until the size change logic has finished restoring the original scroll position.

Thanks Tomi! I'll try this approach.

@mshabarov mshabarov marked this pull request as draft October 13, 2021 14:41
mshabarov and others added 8 commits October 15, 2021 15:10
When the grid web-component is used with Flow Grid component with the undefined lazy loading,
grid's size change leads to scroller jump to 0 index (iron list specifics).
It causes as many pages requested from backend, as the current page is.
E.g. if the page is 20, then the requested items range would be about 1000 items.
And the requested items count increases as grid is being scrolled further.

This issue is also observed within fast scroll, so the number of requested pages increases significantly.
With this fix, if the pending pages count is too much and the current requested page is far away of pending page range,
this page request will be ignored and the data provider wouldn't be called.
@tomivirkki tomivirkki force-pushed the fix/limit-pending-pages branch from cc301ec to c038e32 Compare October 15, 2021 12:13
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@mshabarov mshabarov marked this pull request as ready for review October 15, 2021 12:21
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with platform 22.0.0.beta1 and is also targeting the upcoming stable 22.0.0 version.

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

Successfully merging this pull request may close these issues.

4 participants