Repository navigation
Revert "refactor: avoid unnecessary re-renders on virtualizer size change (#5650)" - #7205
Conversation
| 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.
Is there a related issue to fix this?
There was a problem hiding this comment.
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. |
| el.index = index; | ||
| el.id = `item-${index}`; | ||
| el.textContent = el.id; | ||
| el.style.right = '0'; |
There was a problem hiding this comment.
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.
note: Setting a fixed height prevents test failures related to differences in font rendering across browsers.
|
| 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.
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.




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