-
Notifications
You must be signed in to change notification settings - Fork 85
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
Revert "refactor: avoid unnecessary re-renders on virtualizer size change (#5650)" #7205
Conversation
packages/component-base/test/virtualizer-unlimited-size.test.js
Outdated
Show resolved
Hide resolved
expect(item.getBoundingClientRect().top).to.be.closeTo(scrollTarget.getBoundingClientRect().top - 10, 1); | ||
}); | ||
|
||
// FIXME: Fails due to a scroll offset reset caused by _adjustVirtualIndexOffset on scroll event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a related issue to fix this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. My plan was to report it after the merge because it's only reproducible with the scroll restoration logic.
As stated by @tomivirkki, this PR seems to also fix #7160. For that reason, I will move the test in the PR to fix that issue and close that one. |
@@ -22,6 +22,13 @@ describe('unlimited size', () => { | |||
el.index = index; | |||
el.id = `item-${index}`; | |||
el.textContent = el.id; | |||
el.style.right = '0'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Most of the styles are added to make debugging easier.
el.style.display = 'flex'; | ||
el.style.alignItems = 'center'; | ||
el.style.background = index % 2 === 0 ? '#e7e7e7' : '#d0d0d0'; | ||
el.style.height = '30px'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: Setting a fixed height prevents test failures related to differences in font rendering across browsers.
|
@@ -184,40 +195,43 @@ describe('virtualizer', () => { | |||
expect(item.getBoundingClientRect().top).to.equal(scrollTarget.getBoundingClientRect().top - 10); | |||
}); | |||
|
|||
it('should not request item updates on size increase', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note: After this PR is merged, I'll create an issue for further research on how to prevent item updates on size change without sacrificing the scroll restoration.
…ange (#5650)" (#7205) Co-authored-by: ugur-vaadin <[email protected]>
…ange (#5650)" (#7205) (#7236) Co-authored-by: Sergey Vinogradov <[email protected]> Co-authored-by: ugur-vaadin <[email protected]>
Description
The PR reverts #5650 due to several regressions mentioned below, and also adds tests that should prevent such regressions in the future.
Fixes #7079
Fixes #7186
Fixes #7160
Type of change