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

fix: manual virtual index adjustments (CP: 14.8) #2217

Merged
merged 7 commits into from
May 16, 2022

Conversation

tomivirkki
Copy link
Member

@tomivirkki tomivirkki commented May 13, 2022

@tomivirkki tomivirkki marked this pull request as draft May 13, 2022 10:46
Comment on lines +285 to +301
const isScrollingDown = delta >= 0;
const reusables = this._getReusables(!isScrollingDown);

if (reusables.indexes.length) {
// After running super._scrollHandler, fix internal properties to workaround an iron-list issue.
// See https://github.com/vaadin/web-components/issues/1691
this._physicalTop = reusables.physicalTop;

if (isScrollingDown) {
this._virtualStart -= reusables.indexes.length;
this._physicalStart -= reusables.indexes.length;
} else {
this._virtualStart += reusables.indexes.length;
this._physicalStart += reusables.indexes.length;
}
this._update(reusables.indexes, !isScrollingDown);
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically a copy of the logic in iron-list's _scrollHandler. In certain situation (with large enough item count and scrollbar scrolling) the logic may not get executed when it should.

@tomivirkki tomivirkki marked this pull request as ready for review May 13, 2022 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[grid] Dragging with scrollbar shifts table body downwards
2 participants