Comments (10)
@Ethorsen I found the culprit. I will look into a few other issues and release an update during the weekend.
from react-virtuoso.
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.
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.
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.
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.
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.
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.
Thx
from react-virtuoso.
Hey @Ethorsen, updated your example to the latest version - it seems to work as expected. Cheers.
from react-virtuoso.
Yes, working nicely and as expected since 12.6. Thx a lot
from react-virtuoso.
Related Issues (20)
- [BUG] `restoreStateFrom` appears to have a race condition when restoring state on component mount HOT 8
- React Virtuoso Message List - ref.current.scrollToItem based on the item.data instead of using the item index?
- [BUG] npm run browse-examples HOT 1
- [BUG] Simple header breaks restore state location HOT 3
- [BUG] When used in MUI's Tooltip component, extra white space will appear. HOT 1
- Chrome52 is not compatible HOT 1
- [BUG] Grid jittering/flickering HOT 1
- [BUG] VirtuosoGrid - endReached doesn't call if data set is less then the container HOT 1
- Drag the scrolllbar makes the grid blink in Firefox, but not in Chromium or Edge... HOT 1
- [BUG] react-beautiful-dnd + useWindowScroll HOT 1
- [BUG] followOutput doesn't scroll to bottom HOT 2
- [BUG] element disappearing when reverse scrolling in the ios HOT 4
- [BUG]After packaging a project that uses react-virtuoso, there is a problem embedding it into the iframe of another domain name HOT 2
- [BUG] `InitialTopMostItemIndex` causes variable height elements to blink/jump when scrolling up. HOT 1
- [BUG] Border does not get respected with fixed headers HOT 3
- Drag and drop not working as intended on mobile devices when using react-beautiful-dnd with react-virtuoso HOT 2
- [BUG] followOutput does not scroll al the way to bottom HOT 3
- [BUG] (virtuoso-message-list) strange scrolling on ipad HOT 2
- [BUG] Inability to use a flex container as a parent or to customize viewport
- [BUG] ScrollSeekPlaceholder in grouping mode create sticky placeholder item on the top of list HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-virtuoso.