Comments (5)
Yeah, I figured it out using plain old CSS.
I think the key is to ensure that all parent components have a height
assigned right back to #root
and then use some flex settings.
I've knocked up a simple code sandbox for you to look at here. The only thing I had to mess around with was the height of the .box
bit, as a pure 100% would always leave a few straggling pixels off the bottom so I ended up with a double scroll bar from the window and the Virtuoso
component. Fixed that with a 95% or similar on the box, then set the Virtuoso
component style to 100% - always fits now, never goes off the bottom of the screen... unless I make the whole thing super small.
Keys are:
- Make sure everything above has a height set
- Make the grandparent(?) of the
Virtuoso
component has a flex type with column - Make sure to wrap the
Virtuoso
component in adiv
with a flex and height setting - Ensure the
Virtuoso
component has a style applied that sets the height to some %
from react-virtuoso.
Never mind. It can be resolved with pure CSS using flex.
from react-virtuoso.
@fonty422 - I'm struggling with the same thing. Did you apply flex settings (I'm guessing flex-grow) to the Virtuoso component or its parent?
from react-virtuoso.
Except that today, for no known reason just yet, it stopped working in my code. I figured there was something I changed in the main code that messes something up, but no! Even the sandbox above no longer works... at least in Chrome. But Firefox works, so what;s going on there???
from react-virtuoso.
Strangely, the .content style now needs a height in Chrome, which it didn't when I wrote that sandbox code. Very strange
from react-virtuoso.
Related Issues (20)
- [BUG] Table scrolls to top when search params change HOT 1
- [BUG] Not unloading no longer visible items HOT 3
- EndReached is not called when the height of the container is greater than the total height of the loaded items HOT 1
- [BUG] Zero-sized element, this should not happen HOT 3
- [BUG] Flickering of Dynamic Elements When Scrolling Up HOT 1
- Announcement:: Message List Component
- How do I customize/add style to the wrapper <DIV> for Header/Footer in react-virtuoso?
- [BUG] - Possible bug with GroupedVirtuoso initialTopMostItemIndex and resizing items HOT 1
- [BUG] Unable to scroll to absolute bottom if there is a footer with position: sticky HOT 9
- How to specify a row in Virtuoso List so that it does not unload when scrolling HOT 2
- [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
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.