react-virtuoso icon indicating copy to clipboard operation
react-virtuoso copied to clipboard

Footer with VirtuosoGrid?

Open NTag opened this issue 5 years ago • 10 comments
trafficstars

Is it possible to have a footer with VirtuosoGrid? Which wouldn't be part of the grid but below it. If I try to add a footer prop to VirtuosoGrid I have a typing error.

NTag avatar Nov 11 '20 15:11 NTag

Not supported currently, but easy to add. If you decide to contribute, I may suggest you wait for a week or so, since I am in the middle of a large refactor.

petyosi avatar Nov 11 '20 17:11 petyosi

@petyosi Is there a chance for this to be resolved? I'm looking for a header/footer solution to add top and bottom paddings to the scroller, just like we do in the regular List component.

I tried to contribute but the learning curve of the implementation makes this difficult since it's new behavior for grid.

Thank you!

itayganor avatar Apr 26 '21 08:04 itayganor

@petyosi I think it's quite common to have top and bottom paddings in layouts, and most of us are "hacking" that with the Header and Footer components. What do you think about just adding a simple prop for the vertical paddings? (I'm willing to do a PR, I'd appreciate if you could point me to the relevant files tho!)

harrisonlo avatar May 19 '21 23:05 harrisonlo

@harrisonlo I am hesitant of adding styling props, to be honest - all in all, they won't be easier to implement than Header/Footer.

If you want to introduce header and footer, here's the rough checklist:

petyosi avatar May 20 '21 06:05 petyosi

@petyosi Thanks for the reply. I saw that the paddingTop and paddingBottom values are updated inline as you scroll, so I thought when it reaches top or bottom (for which there seem to be logics already in place, with atTopStateChange etc.) we can simply set the value to something other than 0? That said, I haven't looked too much into the code to know if it'll break something.

harrisonlo avatar May 24 '21 10:05 harrisonlo

Hello, how about this issue? Do you have any plan to support it?

hungnguyentiki avatar Oct 31 '21 16:10 hungnguyentiki

How is this feature supposed to work? Should the header / footer item be the first / last item of the grid or should it be separate and always represented in a new line? Here an example for the footer:

Option 1: The Footer Item is the last item of the grid. Screenshot 2022-01-23 at 00 15 16

Option 2: The Footer Item is always in a new row under the last grid row. Screenshot 2022-01-23 at 00 16 39

joachimklug avatar Jan 22 '22 23:01 joachimklug

Should the header / footer item be the first / last item of the grid or should it be separate and always represented in a new line?

The first option would be called lastItem rather than footer.

Although one might see the footer (and header) as a "full-width item", they are actually content padders.

itayganor avatar Feb 03 '22 15:02 itayganor

@petyosi The docs show an example of endless scrolling with Virtuoso + endReached + Footer. VirtuosoGrid has endReached but no Footer. Is there another way to show "Loading..." message for endless scrolling in this case?

cnt-null avatar Mar 25 '22 16:03 cnt-null

Is there any update on this ?

erandow avatar Jun 22 '22 06:06 erandow

:tada: This issue has been resolved in version 3.1.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

github-actions[bot] avatar Oct 16 '22 18:10 github-actions[bot]