React-table: Rendering blank rows instead of no rows...

Created on 26 Jan 2018  路  3Comments  路  Source: tannerlinsley/react-table

What version of React-Table are you using?

6.7.6

What bug are you experiencing, or what feature are you proposing?

https://react-table.js.org/#/story/simple-table
Set the page size to 100.
Go to page 56.
See a bunch of blank rows rendered after the content finishes.

Most helpful comment

It renders blank rows when the number of rows is not enough to fill the page.

I know, hence the bug report. Why was this design decision made? It seems like the default option should be the opposite.

I found minRows={0} after scouring the docs and other bug reports, but I'm not sure that is being used correctly.

All 3 comments

It's supposed to do that.

It renders blank rows when the number of rows is not enough to fill the page.

There's even a component you can override to render something for the blank rows that suits you.....

PadRowComponent: () => <span>&nbsp;</span>, // the content rendered inside of a padding row

It renders blank rows when the number of rows is not enough to fill the page.

I know, hence the bug report. Why was this design decision made? It seems like the default option should be the opposite.

I found minRows={0} after scouring the docs and other bug reports, but I'm not sure that is being used correctly.

It is not a "bug" because the owner decided to make it work that way to the paging control does not move from under the users mouse when they hit the last page.

It was one of the features of the product that made me choose it in the first place. For a paged solution (especially with a lot o pages), you don't want to make the user have to move the mouse vertically to get to the "previous" button (because after having paged forward, the have a mental picture of where the previous button is - even if they don't realise it)

minRows can be used in the manner you are describing. The only issue is if there are NO records in the table at all as the default "no data" message is a floating div and will display over the header and footer. However, you can set that to a sensible minimum like 3 but that does mean if there is only 1 row on the last page that 2 padding rows will appear.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pasichnyk picture pasichnyk  路  3Comments

bdkersey picture bdkersey  路  3Comments

DaveyEdwards picture DaveyEdwards  路  3Comments

dilipsundarraj1 picture dilipsundarraj1  路  3Comments

tremby picture tremby  路  3Comments