Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Add Infinite scroll #18

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Conversation

kbariotis
Copy link

@kbariotis kbariotis commented Feb 18, 2017

This is my take to resolve #17.

Thank you :)

@watson
Copy link
Member

watson commented Feb 22, 2017

@kbariotis wow, this looks really awesome 😃

Did you look into if it would be possible to load more results automatically as the user scrolls towards the end of the list? - instead of having to click a button (like twitter)

@kbariotis
Copy link
Author

Hello @watson! Thx!

Aw I completely missed that! Well, I guess It would be possible. The only thing that concerns me is that the initial request must fetch so many items that can fill the user's viewport, so she can scroll down and fetch more. We can fetch the user's device on runtime and decide how many to fetch, and then fetch a fixed amount of items for each additional request.

Sounds good? What do you think?

@watson
Copy link
Member

watson commented Feb 23, 2017

I see your point, but let's just keep it pragmatic.

There's a header of 350 pixels above the first result and each result is 44 pixels. So how about just fetching 50 results each time? That would allow for a resolution of 2550 pixels vertically not counting the browser chrome. A newer 27" monitor in portrait orientation have 2560 pixels vertically, so that should be ok.

We could just keep the button but click it programatically when ever the user approaches the end of the list. That way if for some reason the automatic click doesn't fire, the user can just click it him self 😃

@kbariotis
Copy link
Author

Absolutely! Lets try it.

@kbariotis
Copy link
Author

Ready @watson! I kinda duplicate the runSearch function to create one to be used only for the loading more functionality. Is it acceptable? I could try to refactor it.

@watson
Copy link
Member

watson commented Feb 23, 2017

LGTM 😃 - Any input @vanjacosic?

@kbariotis
Copy link
Author

Any update on this @watson @vanjacosic ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pagination or infinite scroll to search results
2 participants