@@ -201,6 +201,7 @@ export class VaPagination {
201
201
// Use case #1: 6 or fewer pages
202
202
return makeArray ( 1 , totalPages ) ;
203
203
} else if ( SHOW_ALL_PAGES < totalPages && totalPages <= maxPageListLength ) {
204
+ console . log ( 'Use case 2' ) ;
204
205
// Use case #2: Total pages is greater than 6 and less than or equal to
205
206
// maxPageListLength. The logic has made affordances for max page list
206
207
// lengths of 8 and below, and the default 10.
@@ -229,16 +230,18 @@ export class VaPagination {
229
230
230
231
return makeArray ( start , end ) ;
231
232
} else if ( currentPage <= radius - 1 ) {
233
+ console . log ( 'Use case 3' ) ;
234
+
232
235
// Use case #3: Current page is less than or equal to
233
236
// half the visible pages minus one. This case always renders
234
237
// [1] in pageNumbers array.
235
238
start = 1 ;
236
239
237
240
switch ( true ) {
238
- case maxPageListLength <= totalPages && isMobileViewport :
239
- end = maxPageListLength - 4 - unboundedChar ;
241
+ case isMobileViewport && maxPageListLength <= totalPages :
242
+ end = maxPageListLength - 5 - unboundedChar ;
240
243
break ;
241
- case maxPageListLength < totalPages :
244
+ case maxPageListLength <= totalPages :
242
245
end = maxPageListLength - 1 - unboundedChar ;
243
246
break ;
244
247
default :
@@ -257,7 +260,7 @@ export class VaPagination {
257
260
// current page gets close to the end.
258
261
259
262
switch ( true ) {
260
- case totalPages - maxPageListLength >= 0 && isMobileViewport :
263
+ case isMobileViewport && totalPages - maxPageListLength >= 0 :
261
264
start = totalPages - ( SHOW_ALL_PAGES - 2 - 1 ) ;
262
265
break ;
263
266
case totalPages - maxPageListLength >= 0 :
0 commit comments