Fixed the grid view pagination. (#79717)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Bohdan Tsymbala 2020-10-06 23:14:09 +02:00 committed by GitHub
parent 4996020087
commit 0a713d3750
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,9 +54,10 @@ const PaginationBar = ({ pagination, onChange }: PaginationBarProps) => {
itemsPerPage={pagination.pageSize}
itemsPerPageOptions={pagination.pageSizeOptions}
pageCount={pageCount}
onChangeItemsPerPage={useCallback((size) => ({ index: 0, size }), [])}
onChangePage={useCallback((index) => ({ index, size: pagination.pageSize }), [
onChangeItemsPerPage={useCallback((size) => onChange({ index: 0, size }), [onChange])}
onChangePage={useCallback((index) => onChange({ index, size: pagination.pageSize }), [
pagination.pageSize,
onChange,
])}
/>
</div>