React-window: Expandable item

Created on 20 Nov 2018  ·  8Comments  ·  Source: bvaughn/react-window

I am working on smaller list where we need an option to expand item (and change height of it). It seems like current api doesn't support that. resetAfterIndex is causing re-rendering, but not refreshing the height of the actual item. Does react-window currently support this option?

👀 needs info

Most helpful comment

I know this is closed for now, but what about an animated expanding div. Not just something with 2 hard coded values. I have a need to use the material-ui ExpansionPanel, but implementing this leaves me with a panel that expands but doesn't displace the rest of the list.

All 8 comments

resetAfterIndex should work for what you're describing. In fact, there are unit tests for this.

Can you please point me at a repro that shows what's not working for you? Here's a Code Sandbox you can fork to get started.

I've added expandable items to Brian's example and it works: https://codesandbox.io/s/kmzrylpx7o
Hope it helps.

I'm going to close this for now. Will re-open if repro steps are provided. 😄

I know this is closed for now, but what about an animated expanding div. Not just something with 2 hard coded values. I have a need to use the material-ui ExpansionPanel, but implementing this leaves me with a panel that expands but doesn't displace the rest of the list.

Thanks for this, it helped me a bunch

@fonty422 Have you ever found a solution for animated expanding divs?

@itayganor I ended up using a different package (react-virtuoso) and going through the less painful (but still painful) method of providing a pre-culled list of items. Also, the material-ui page discussed it as a recommendation (along with react-window) for large lists. The demo page will show you if it's any good for your purposes.

@fonty422 This is amazing. So simple. Thank you!

I actually have a question but I don't want to spam this discussion, so I'm creating it over there.

Was this page helpful?
0 / 5 - 0 ratings