Giter Club home page Giter Club logo

Comments (10)

petyosi avatar petyosi commented on July 30, 2024 1

@Ethorsen I found the culprit. I will look into a few other issues and release an update during the weekend.

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

Hey,

I would recommend looking into the autoSizer as an approach - the itemHeight and groupHeight are meant to be used for uniform size scenarios.

You mention that you have negative margins that you use to visualise overlaps. Can I see that running somewhere? Changes are this scenario can be tuned to work as expected.

Cheers,

from react-virtuoso.

Ethorsen avatar Ethorsen commented on July 30, 2024

I tried many different patterns, and can never get the auto sizer to figure out cell heights correctly as soon as a negative margin is specified.

I'll try to reproduce in a sandbox

from react-virtuoso.

Ethorsen avatar Ethorsen commented on July 30, 2024

I was able to get this thing working for us. Instead of using negative margins for interlace, I'm now using fixed height with visible overflow. In terms of positioning a scrolling, it now works fine.

But I still have a visual bug that I cant figure out. When scrolling slowly, the first element on the screen sometimes appear after it entered the viewport or disappear before it exits the viewport.

To demonstrate, I created a stripped down version of the thing in this sandbox. This will give you a basic idea of what we're trying to achieve (some timeline with events alternating left and right)
https://codesandbox.io/embed/vigorous-heisenberg-c1irs?fontsize=14&hidenavigation=1&theme=dark

You'll notice, if you scroll slowly up and down, that the first item is jumping in and out before exiting or entering the viewport.

I tried playing with the overscan prop but it doesnt seem to make any difference.

Please let me know if you can help me figure this out.

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

Thanks for the repro, I believe I know what's going on.

When I designed the groups, I assumed that the sticky group headers would be non-transparent and occupying the full width of the list viewport. As soon as something passes the bottom border of the group, the code considers it invisible and removes it from the list of items. Removing the width of the group element addresses the problem partially.

By partially, I mean that you will still see the "forced height" items appear later than they should because the component considers them shorter than what they are. There is not much to do about it I'm afraid - I would direct you to the Virtuoso Grid component, but it does not support grouping (and it would be very complicated, to get it right).

I am sorry for not being to help further. What you're trying to achieve - a two-sided overlapping timeline - seems like a very specific use case that I never had in mind when designing the component.

from react-virtuoso.

Ethorsen avatar Ethorsen commented on July 30, 2024

Thanks for taking a look.

Even if its an edge case, I feel we're not far from having this thing work as expected.

I tried to do the opposite, and have the overflow pop above the actual line. But unfortunately it gives the same problem but for the item at bottom of the list.

Correct me if I'm wrong, but isnt the overscan prop used to actually render more items than whats required on screen? If they were already rendered, lets say 500px before entering viewport, they would already be there?

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

What you say sounds right - I will revisit the tests and see if the overscan is actually included in the grouped mode. Flagging it as a bug for now.

from react-virtuoso.

Ethorsen avatar Ethorsen commented on July 30, 2024

Thx

from react-virtuoso.

petyosi avatar petyosi commented on July 30, 2024

Hey @Ethorsen, updated your example to the latest version - it seems to work as expected. Cheers.

from react-virtuoso.

Ethorsen avatar Ethorsen commented on July 30, 2024

Yes, working nicely and as expected since 12.6. Thx a lot

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.