nextui
nextui copied to clipboard
[BUG] - hidden prop of Table.Pagination doesn't work
Describe the bug
Table.Pagination
component has a prop called hidden
. This prop should hide Table.Pagination
, but for some reason it doesn't work and it's still visible.
e.g
<Table.Pagination
noMargin
align="center"
rowsPerPage={rows}
hidden
/>
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
- Create a basic table with
Table.Pagination
- Add the prop
hidden
- Check if the
Table.Pagination
is visible
Expected behavior
hidden
prop of Table.Pagination
should work correctly.
Screenshots or Videos
No response
Operating System Version
macOS
Browser
Chrome
This is perfectly legal behavior (as per specs), maybe not expected but not a bug per se I think:
Changing the display CSS value of an element with the hidden attribute overrides the behavior. For instance, an element styled display: flex will be displayed on screen regardless of the hidden attribute being present.
NextUI: https://github.com/nextui-org/nextui/blob/main/packages/react/src/pagination/pagination.styles.ts#L229
Relation: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden https://html.spec.whatwg.org/multipage/interaction.html#the-hidden-attribute https://lists.w3.org/Archives/Public/public-whatwg-archive/2014Apr/0094.html
@Sylvenas thanks for the explanation, that makes sense. But I think what doesn't make sense is to have a prop that doesn't do the work.
There is a prop called hideHeader
for Table.Column
, maybe we can think of something similar for the pagination component?
Hey @buskerone as @Sylvenas explained the hidden
prop comes from the native
web API for any HTML element, Pagination doesn't include it as a prop, here's the available Pagination
API https://nextui.org/docs/components/pagination#pagination-props