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

initialRenderIndex makes content jump around when non deterministic #241

Open
tafelito opened this issue Aug 27, 2018 · 8 comments
Open

Comments

@tafelito
Copy link
Contributor

When using initialRenderIndex or initialOffset to scroll to the bottom on initial render, using forceNonDeterministicRendering makes content to re accommodate and jump around if the provided estimated height is not close to the final height. This does not happen when not using either initial index or offset.
Sometimes its not possible to know the height beforehand or even an estimated value, like in a chat app.

How would you prevent this?

@naqvitalha
Copy link
Collaborator

Unfortunately, this feature won't work perfectly in non deterministic scenario. The reason is it will become important to skip multiple frames to allow layout to settle down because of async measure. If it's too important you can hide the ListView to 2-3 frames and then call scrollTo again. In future we'll see how we can deal with this. There is a parallel JS scrollview project that we are working on which can potentially fix this.

@tafelito
Copy link
Contributor Author

@naqvitalha what do u mean by waiting and then call scrollTo again? You mean not use the initialRenderIndex?

Is the other project you are working going to be part of RLV? Can we see a sneak peek anywhere?

@saadqbal
Copy link

Hi @tafelito I see you are working on a chat app. Did you find any good solution for a displaying a large list of chat ?

@tragicmj
Copy link

Hi @tafelito , did you got any solution for this.
Is there solution for this @naqvitalha

@prayaslashkari
Copy link

To all facing this issue, I added layout provider and added accurate dimensions there. It started working normally after that.

I would suggest defining fixed height for the list item and building UI with that.

@tragicmj @saadqbal @tafelito

@siddharth-kt
Copy link

@naqvitalha any update on this ?

@tragicmj
Copy link

@callmemonky in case of having chat, I don't think we can add accurate dimensions, as a text can be as short as two lines or as long as 10 lines

@irisjae
Copy link

irisjae commented May 8, 2024

I've published an analysis of this problem and a patch here; feel free to test it out.

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

No branches or pull requests

7 participants