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

scroll moves when adding content #28

Open
dimmetrius opened this issue Sep 12, 2016 · 5 comments
Open

scroll moves when adding content #28

dimmetrius opened this issue Sep 12, 2016 · 5 comments

Comments

@dimmetrius
Copy link

hello, help me find a solution to add content to scroll. When my content inside InvertibleScrollView becomes higher, the component will automatically moves scroll to this height. How to add content and save scroll position?

@ide ide added the wants help label Sep 13, 2016
@ramilushev
Copy link

+1 @dimmetrius did you manage to find a solution?

@dimmetrius
Copy link
Author

@ramilushev My decision is onContentSizeChange event with scrollTo({x:0, y:0, animated:true}); This scrolls list to last added element. But i don't have a solution for save scroll position.

@avclarke
Copy link

avclarke commented Oct 6, 2016

We've managed to maintain position by storing the content length minus offset reverseOffset = contentLength - offset to state in componentWillReceiveProps, so before any new content is rendered, then once rendered, listen to onContentSizeChange and workout the new scroll position to scroll to newContentLength - reverseOffset. The problem with this though is you get a flicker between the changes.

@bennygenel
Copy link

Did anyone find a good solution for this?

@bulz4y
Copy link

bulz4y commented Jan 16, 2022

I am facing the same issue. Did anyone find a solution for this ?

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

No branches or pull requests

6 participants