We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination drop-down (onItemsPerPageChange) not working inside modal (working fine in screen)
Pagination drop-down (onItemsPerPageChange) need to open drop down options when click on (onItemsPerPageChange)
reproduce?
const itemPerPage = 5,totalRecords = 25 (but it depends on data coming from backend) const [page,setPage] = useState(1);
<DataTable.Pagination style={styles.rowJusCen} page={page === 1 ? 0 : page - 1} numberOfPages={ itemPerPage === "All" ? 0 : Math.ceil(totalRecords / itemPerPage) === 1 ? 0 : Math.ceil(totalRecords / itemPerPage) } onPageChange={(p: number) => { setPage(p >= page ? p + 1 : p === 0 ? 1 : p); }} numberOfItemsPerPageList={[ "All", 5, 10, 25, 50,]} numberOfItemsPerPage={5} onItemsPerPageChange={setItemPerPage} showFastPaginationControls dropdownItemRippleColor={colors?.colors?.activeOption} />
Pagination dropdown working fine inside screen , but not working inside modal popup. Both has same code (same component)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Current behaviour
Pagination drop-down (onItemsPerPageChange) not working inside modal (working fine in screen)
Expected behaviour
Pagination drop-down (onItemsPerPageChange) need to open drop down options when click on (onItemsPerPageChange)
How to
const itemPerPage = 5,totalRecords = 25 (but it depends on data coming from backend)
const [page,setPage] = useState(1);
<DataTable.Pagination
style={styles.rowJusCen}
page={page === 1 ? 0 : page - 1}
numberOfPages={
itemPerPage === "All"
? 0
: Math.ceil(totalRecords / itemPerPage) === 1
? 0
: Math.ceil(totalRecords / itemPerPage)
}
onPageChange={(p: number) => {
setPage(p >= page ? p + 1 : p === 0 ? 1 : p);
}}
numberOfItemsPerPageList={[ "All", 5, 10, 25, 50,]}
numberOfItemsPerPage={5}
onItemsPerPageChange={setItemPerPage}
showFastPaginationControls
dropdownItemRippleColor={colors?.colors?.activeOption}
/>
Preview
Pagination dropdown working fine inside screen , but not working inside modal popup.
Both has same code (same component)
Your Environment
The text was updated successfully, but these errors were encountered: