Skip to content

Make hidePageListOnlyOnePage work on PaginationListStandalone #1279

Closed
@kevinashworth

Description

@kevinashworth

Is this feature requested before?
I don't see this requested before.

Is your feature request related to a problem? Please describe.

https://codesandbox.io/s/vigilant-tdd-owuxk
Load the sandbox, then select any page size over 10, and you'll see a pagination list that says "1", even though hidePageListOnlyOnePage: true.

More info on what I see in the code
TLDR: The same classes and HTML tags do not get generated when it's standalone.

In the codesandbox source view, I see class react-bootstrap-table-page-btns-ul on a ul tag for PaginationListStandalone.

Looking in the main repo for a default, non-standalone pagination list, I see variable pageListClass applied to a div and it is modified by the hidePageListOnlyOnePage flag:

const pageListClass = cs(
'react-bootstrap-table-pagination-list',
'col-md-6 col-xs-6 col-sm-6 col-lg-6', {
'react-bootstrap-table-pagination-list-hidden': (hidePageListOnlyOnePage && totalPages === 1)
});

Apparently, there is no such code that gets called in the standalone pagination list, thus hidePageListOnlyOnePage does not work on PaginationListStandalone.

Describe the solution you'd like
Have the same logic, classes and tags on the pagination list whether it's standalone or non-standalone, so that hidePageListOnlyOnePage works in both cases.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions