File tree Expand file tree Collapse file tree 2 files changed +27
-23
lines changed Expand file tree Collapse file tree 2 files changed +27
-23
lines changed Original file line number Diff line number Diff line change @@ -414,17 +414,20 @@ const DxcDataGrid = ({
414414 summaryRowHeight = { colHeight }
415415 className = "fill-grid"
416416 />
417- { showPaginator && ( totalItems ?? rows . length ) > itemsPerPage && (
418- < DxcPaginator
419- totalItems = { totalItems ?? rows . length }
420- itemsPerPage = { itemsPerPage }
421- itemsPerPageOptions = { itemsPerPageOptions }
422- itemsPerPageFunction = { itemsPerPageFunction }
423- currentPage = { page }
424- showGoToPage = { showGoToPage }
425- onPageChange = { goToPage }
426- />
427- ) }
417+
418+ { showPaginator &&
419+ ( itemsPerPageOptions ?. some ( ( itemsPerPage ) => ( totalItems ?? rows . length ) > itemsPerPage ) ||
420+ ( totalItems ?? rows . length ) > itemsPerPage ) && (
421+ < DxcPaginator
422+ totalItems = { totalItems ?? rows . length }
423+ itemsPerPage = { itemsPerPage }
424+ itemsPerPageOptions = { itemsPerPageOptions }
425+ itemsPerPageFunction = { itemsPerPageFunction }
426+ currentPage = { page }
427+ showGoToPage = { showGoToPage }
428+ onPageChange = { goToPage }
429+ />
430+ ) }
428431 </ DataGridContainer >
429432 ) ;
430433} ;
Original file line number Diff line number Diff line change @@ -150,18 +150,19 @@ const DxcResultsetTable = ({
150150 ) ) }
151151 </ tbody >
152152 </ DxcTable >
153- { ! hidePaginator && rows . length > itemsPerPage && (
154- < DxcPaginator
155- currentPage = { page }
156- itemsPerPage = { itemsPerPage }
157- itemsPerPageFunction = { itemsPerPageFunction }
158- itemsPerPageOptions = { itemsPerPageOptions }
159- onPageChange = { goToPage }
160- showGoToPage = { showGoToPage }
161- tabIndex = { tabIndex }
162- totalItems = { rows . length }
163- />
164- ) }
153+ { ! hidePaginator &&
154+ ( itemsPerPageOptions ?. some ( ( itemsPerPage ) => rows . length > itemsPerPage ) || rows . length > itemsPerPage ) && (
155+ < DxcPaginator
156+ currentPage = { page }
157+ itemsPerPage = { itemsPerPage }
158+ itemsPerPageFunction = { itemsPerPageFunction }
159+ itemsPerPageOptions = { itemsPerPageOptions }
160+ onPageChange = { goToPage }
161+ showGoToPage = { showGoToPage }
162+ tabIndex = { tabIndex }
163+ totalItems = { rows . length }
164+ />
165+ ) }
165166 </ ResultsetTableContainer >
166167 ) ;
167168} ;
You can’t perform that action at this time.
0 commit comments