File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
packages/lib/src/resultset-table Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -105,11 +105,15 @@ const DxcResultsetTable = ({
105105 if ( ! hidePaginator ) {
106106 if ( rows . length === 0 ) {
107107 changePage ( 0 ) ;
108- } else if ( rows . length < prevRowCountRef . current ) {
109- const lastPage = Math . ceil ( rows . length / itemsPerPage ) ;
110- const prevLastPage = Math . ceil ( prevRowCountRef . current / itemsPerPage ) ;
111- if ( lastPage < prevLastPage ) {
112- changePage ( Math . min ( lastPage , page ) ) ;
108+ } else {
109+ if ( page === 0 ) {
110+ changePage ( 1 ) ;
111+ } else if ( rows . length < prevRowCountRef . current ) {
112+ const lastPage = Math . ceil ( rows . length / itemsPerPage ) ;
113+ const prevLastPage = Math . ceil ( prevRowCountRef . current / itemsPerPage ) ;
114+ if ( lastPage < prevLastPage ) {
115+ changePage ( Math . min ( lastPage , page ) ) ;
116+ }
113117 }
114118 }
115119 prevRowCountRef . current = rows . length ;
You can’t perform that action at this time.
0 commit comments