Coder Social home page Coder Social logo

FixedSizeList padding about react-window HOT 5 CLOSED

bvaughn avatar bvaughn commented on May 22, 2024
FixedSizeList padding

from react-window.

Comments (5)

henryoliver avatar henryoliver commented on May 22, 2024 1

Just subtract a given offset from the grid height:

const HEADER_OFFSET = 72;
...
return (
  <FixedSizeGrid
    ref={photoGridRef}
    width={width}
    height={height - HEADER_OFFSET}
    rowCount={rowCount}
    rowHeight={rowHeight}
    ...

from react-window.

bvaughn avatar bvaughn commented on May 22, 2024

No, padding like that isn't really supported within the list. If you want padding around the list, put the list inside of a padded container. 😊

This helps keeps the positioning logic inside of the list as simple as it can be.

from react-window.

khlieng avatar khlieng commented on May 22, 2024

Ah ok, I wanted the padding inside the list like this https://jsfiddle.net/9wpd58mx/6/, I could just do it with a VariableSizeList.

from react-window.

bvaughn avatar bvaughn commented on May 22, 2024

Oh, thanks for clarifying. I misunderstood! πŸ˜„

Yup, the easiest way to do that would be by adding in "padding" rows– one to the beginning and one to the end of your list.

from react-window.

ahtcx avatar ahtcx commented on May 22, 2024

This can be fixed by adding position: relative; to the list, should I make a PR with a fix @bvaughn ?

from react-window.

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.