-
Notifications
You must be signed in to change notification settings - Fork 427
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 for scroll to offset api #219
Conversation
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.
LGTM
src/core/RecyclerListView.tsx
Outdated
@@ -304,7 +300,7 @@ export default class RecyclerListView<P extends RecyclerListViewProps, S extends | |||
|
|||
public getCurrentScrollOffset(): number { | |||
const viewabilityTracker = this._virtualRenderer.getViewabilityTracker(); | |||
return viewabilityTracker ? viewabilityTracker.getLastOffset() : 0; | |||
return (viewabilityTracker ? viewabilityTracker.getLastOffset() : 0) + this.props.distanceFromWindow!; |
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.
If think it should be 0 if viewability tracker is unavailable otherwise without doing anything there will be a non zero offset.
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.
Also, minimum offset for viewability tracker is zero. Thus this should only be attributed if lastOffset > distanceFromWindow
Adding distanceFromWindow to currentOffset only if viewability tracker’s offset is geater than distanceFromWindow
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.
LGTM
No description provided.