Skip to content

fix: scrollTop issue on mobile in inverse mode #257

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

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

Conversation

vj-abishek
Copy link

Fixes #242

The issue is when we use flexDirection: 'column-reverse' . The scroll bar is set to the bottom. On desktop the scrollTop ends with 0 if it reaches the bottom. But it mobile scrollTop behaves oppositely due to flexDirection: 'column-reverse'. The scrollTop starts from 0 at the top in mobile.

An example which breaks on mobile: Link (check on mobile)

An example which works on mobile Link (check on mobile)

@s-kris
Copy link

s-kris commented Mar 17, 2021

Thanks @vj-abishek
@ankeetmaini any plans to merge this fix?

@ankeetmaini
Copy link
Owner

Can a test be added for this fix? Will make it easier for me to merge

@vj-abishek
Copy link
Author

vj-abishek commented Mar 18, 2021

It seems like browser issue. Before making this pull request I tested in brave browser and chrome. Both breaked. After some days I updated brave browser. Now when I test this. It is working in brave but breaking in chrome(current solution).

Mine solution(working in both browses) and current solution is also working (current solution is working only in brave).

I will test and say if it is worth to merge.

@vj-abishek
Copy link
Author

Any please try to open those link and say if it works or breakes in mobile.

@s-kris
Copy link

s-kris commented Mar 18, 2021

Strangely, both of the links work in chrome android.

@s-kris
Copy link

s-kris commented Mar 18, 2021

This bug affects normal mode too. (not just inverse mode)

@vj-abishek
Copy link
Author

@s-kris I got exams so only didn't have time to work on it.

@s-kris
Copy link

s-kris commented Mar 29, 2021

Hey @vj-abishek no explanation needed :)
Wish you the best!

@vj-abishek
Copy link
Author

@s-kris it looks like browser issue on mobile. It seems they fixed it. I think it works in latest browsers. Only won't work in browsers which is not using latest version.

@s-kris
Copy link

s-kris commented Apr 2, 2021

I'm using default mode (not inverse mode). Just tested in chrome android (latest version), firefox + edge + chrome on macbook but as mobile mode using developer tools but still not working. Fetch more function is not called.

@vj-abishek
Copy link
Author

vj-abishek commented Apr 11, 2021

After testing in mobile devices I came to one conclusion
This breaks in Chrome: 80.0.3987.99(android) or below
But works in Chrome: 88.0.4324.182(android)

And Normal scroll works correctly for me. If it is not working say me the chrome version, I will test it. It works in chrome 80 or above

And reverse scroll is breaking in chrome 80 or below(android), due to the above mentioned issue.

I don't know what to do for my app, If chrome version is 80 , it is working correctly(reverse scroll) due to my code . But it is chrome 88 It breaks. Some of the users updated chrome. And some didnt including me because there is some issue in updating chrome android. So infinite scroll not working for some users 😣

@jamalsoueidan
Copy link

@vj-abishek Any plans to merge this, it doesnt work on mobile when using column-reverse

@vj-abishek
Copy link
Author

@jamalsoueidan This PR fixes issues related to Chrome Android version 80 and below.

Could you check with these two links?
Codesandbox (Mobile - Original package code)
Codesandbox (Mobile - With this current PR code)

I made a separate patch for my app using this method.
https://github.com/vj-abishek/airdrop/blob/master/package.json#L37

It looks like the package was inactive.

Also, could you check this PR regarding scrollThreshold?
#382

@jamalsoueidan
Copy link

jamalsoueidan commented Aug 19, 2024

@jamalsoueidan This PR fixes issues related to Chrome Android version 80 and below.

Could you check with these two links? Codesandbox (Mobile - Original package code) Codesandbox (Mobile - With this current PR code)

I made a separate patch for my app using this method. https://github.com/vj-abishek/airdrop/blob/master/package.json#L37

It looks like the package was inactive.

Also, could you check this PR regarding scrollThreshold? #382

Thank you very much for your prompt reply.

I ended with building a solution like this:
https://github.com/jamalsoueidan/whatsapp-superchat/blob/main/src/components/InfiniteScroll.tsx

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.

Infinite Scroll works on desktop, breaks on mobile.
4 participants