@@ -339,7 +339,7 @@ class Pagination extends React.Component {
339339 const { pagerCount } = props ;
340340 const boundaryRemainder = pagerCount % 2 === 0 ? 1 : 0 ;
341341 const goButton = ( props . showQuickJumper && props . showQuickJumper . goButton ) ;
342- const halfPagerCount = Math . max ( 1 , Math . floor ( pagerCount / 2 ) ) ;
342+ const halfPagerCount = Math . max ( 1 , Math . floor ( ( pagerCount - 1 ) / 2 ) ) ;
343343 const pageBufferSize = props . showLessItems ? 1 : halfPagerCount ;
344344 const { current, pageSize } = this . state ;
345345
@@ -430,7 +430,7 @@ class Pagination extends React.Component {
430430 ) ;
431431 }
432432
433- if ( allPages <= pagerCount + pageBufferSize * 2 ) {
433+ if ( allPages <= pageBufferSize * 2 + boundaryRemainder + 1 ) {
434434 const pagerProps = {
435435 locale,
436436 rootPrefixCls : prefixCls ,
@@ -546,15 +546,15 @@ class Pagination extends React.Component {
546546 />
547547 ) ;
548548
549- let left = Math . max ( 1 , current - pageBufferSize ) ;
550- let right = Math . min ( current + pageBufferSize - boundaryRemainder , allPages ) ;
549+ let left = Math . max ( 1 , current - pageBufferSize - boundaryRemainder ) ;
550+ let right = Math . min ( current + pageBufferSize , allPages ) ;
551551
552552 if ( current - 1 <= pageBufferSize ) {
553- right = 1 + pageBufferSize * 2 - boundaryRemainder ;
553+ right = 1 + pageBufferSize * 2 + boundaryRemainder ;
554554 }
555555
556- if ( allPages - current <= pageBufferSize ) {
557- left = allPages - pageBufferSize * 2 ;
556+ if ( allPages - current < pageBufferSize ) {
557+ left = allPages - pageBufferSize * 2 - boundaryRemainder ;
558558 }
559559
560560 for ( let i = left ; i <= right ; i ++ ) {
@@ -574,10 +574,7 @@ class Pagination extends React.Component {
574574 ) ;
575575 }
576576
577- if (
578- current - boundaryRemainder > pageBufferSize &&
579- current !== boundaryRemainder + pageBufferSize + 1
580- ) {
577+ if ( current - boundaryRemainder - 2 > pageBufferSize ) {
581578 pagerList [ 0 ] = React . cloneElement ( pagerList [ 0 ] , {
582579 className : `${ prefixCls } -item-after-jump-prev` ,
583580 } ) ;
0 commit comments