Giter Club home page Giter Club logo

Comments (5)

fonty422 avatar fonty422 commented on July 30, 2024 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:

  1. Make sure everything above has a height set
  2. Make the grandparent(?) of the Virtuoso component has a flex type with column
  3. Make sure to wrap the Virtuoso component in a div with a flex and height setting
  4. Ensure the Virtuoso component has a style applied that sets the height to some %

from react-virtuoso.

fonty422 avatar fonty422 commented on July 30, 2024 1

Never mind. It can be resolved with pure CSS using flex.

from react-virtuoso.

jaskinn avatar jaskinn commented on July 30, 2024

@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.

fonty422 avatar fonty422 commented on July 30, 2024

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.

fonty422 avatar fonty422 commented on July 30, 2024

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)

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.