Giter Club home page Giter Club logo

Comments (6)

petyosi avatar petyosi commented on July 30, 2024 1

Got it, thanks for the repro steps!

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

You are correct in your statement - the list assumes the "default" value from the first item rendered (it has to take it from somewhere, and maybe a "defaultItemHeight" property would help).

However, there is a self-repairing mechanism that will append additional items if the assumption is wrong. I took your example and it seems to work fine here, but perhaps I am missing something.

Can you please elaborate on how I can reproduce the incorrect behavior.

from react-virtuoso.

Shadowlauch avatar Shadowlauch commented on July 30, 2024

To reproduce the error I got you have to scroll fast down to the smaller items and then abruptly stop. That sometimes leads to an empty viewport. It is a bit easier to do with a larger list size: https://stackblitz.com/edit/react-compvw-bkco4s

Once you are in that state the list does not seem to use the recovery mechanism you spoke of anymore.
2020-01-09-14-04-07

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

Confirming that this is a bug, I found a solution but need to test it for possible performance regression. If everything is good, I will release a fix over the weekend.

from react-virtuoso.

Shadowlauch avatar Shadowlauch commented on July 30, 2024

@petyosi Thanks for the quick response!

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

Published 0.12.4 and updated the example with it. You can see how the shorter items are re-filled with new ones.

A property that can improve the behavior in this case is defaultItemHeight - something which I consider.

from react-virtuoso.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.