recyclerlistview
recyclerlistview copied to clipboard
initialRenderIndex makes content jump around when non deterministic
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?
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.
@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?
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 ?
Hi @tafelito , did you got any solution for this. Is there solution for this @naqvitalha
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
@naqvitalha any update on this ?
@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