Skip to content
This repository was archived by the owner on Jun 10, 2020. It is now read-only.
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

Loading elements displayBottomUpwards does not accurately update scroll #259

@yiziz

Description

@yiziz

I'm trying to make a chat app. I have displayBottomUpwards set as true and I'm using elementHeight to set the container height since each child could have a different height. I'm using an onHeightChange callback that gets called by the children on their componentDidMount func to update the elementHeight array after the they get rendered and their heights can be determined from the DOM. As far as I can tell, the element's heights are being set correctly.

I'm want to load more messages once I scroll to the top. Unfortunately, after I scroll to the top and the messages are loaded into the react infinite element, the scroll position does not update and is still at the top. How do I fix the scroll such that it continues from the spot it was at when messages were being loaded?

I've attached a gif of what's happening. You can see the "jump" to the first previous message, but in reality, the scroll position never changes, the previous messages are just added to the top.

https://gfycat.com/BarrenSelfishIberianemeraldlizard

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions