Skip to content

current offset fixes#242

Open
manishPatwari wants to merge 2 commits intomasterfrom
currentOffset
Open

current offset fixes#242
manishPatwari wants to merge 2 commits intomasterfrom
currentOffset

Conversation

@manishPatwari
Copy link
Collaborator

No description provided.

const viewabilityTracker = this._virtualRenderer.getViewabilityTracker();
return viewabilityTracker ? viewabilityTracker.getLastActualOffset() + this.props.distanceFromWindow! : 0;
let currentOffset = (viewabilityTracker ? viewabilityTracker.getLastActualOffset() : 0);
if (currentOffset > this.props.distanceFromWindow) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

While this will fix the specific issue internally, this doesn't look correct. An example would be having scrolled very little such that it is < distanceFromWindow. We will get 0 as the current offset which is incorrect because there indeed is a valid scroll offset

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.

3 participants