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

fixed scrolling to top issue #114 #138

Closed

Conversation

Shanmugapriya03
Copy link

@Shanmugapriya03 Shanmugapriya03 commented Oct 5, 2019

This PR will fix unnecessary scroll in 'Older' button #114

Copy link
Member

@lotrien lotrien left a comment

Choose a reason for hiding this comment

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

hey @Shanmugapriya03 this line can't be removed so easily.
The common way how it should work is: user clicks 'Older' (or 'Newer') and I want him to see snippets from very top of the new page, so I need scrollTop() function to be there.

Issue is a corner case here: we show 20 snippets on the page by default, BUT when there are less than 20 snippets left on the next page (f.e 2 or 3, small amount) and user clicks button to load them -> page tries to execute scrollTop() even if there is no need for this.

Since we use live server (it will be very annoying to reach the end of the list) to reproduce this you might use Fiddler or something like it to mock snippets response with 21 snippet or so. (Or just hardcode snippets object :))

@Shanmugapriya03
Copy link
Author

hey @Shanmugapriya03 this line can't be removed so easily.
The common way how it should work is: user clicks 'Older' (or 'Newer') and I want him to see snippets from very top of the new page, so I need scrollTop() function to be there.

Issue is a corner case here: we show 20 snippets on the page by default, BUT when there are less than 20 snippets left on the next page (f.e 2 or 3, small amount) and user clicks button to load them -> page tries to execute scrollTop() even if there is no need for this.

Since we use live server (it will be very annoying to reach the end of the list) to reproduce this you might use Fiddler or something like it to mock snippets response with 21 snippet or so. (Or just hardcode snippets object :))

Sure will take a look into it and fix this issue!

@lotrien lotrien closed this Oct 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants