File tree 2 files changed +22
-2
lines changed
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -523,9 +523,10 @@ const Pagination: React.FC<PaginationProps> = (props) => {
523
523
onClick = { prevHandle }
524
524
tabIndex = { prevDisabled ? null : 0 }
525
525
onKeyDown = { runIfEnterPrev }
526
- className = { classNames ( `${ prefixCls } -prev` , {
526
+ className = { classNames ( `${ prefixCls } -prev` , paginationClassNames ?. item , {
527
527
[ `${ prefixCls } -disabled` ] : prevDisabled ,
528
528
} ) }
529
+ style = { styles ?. item }
529
530
aria-disabled = { prevDisabled }
530
531
>
531
532
{ prev }
@@ -551,9 +552,10 @@ const Pagination: React.FC<PaginationProps> = (props) => {
551
552
onClick = { nextHandle }
552
553
tabIndex = { nextTabIndex }
553
554
onKeyDown = { runIfEnterNext }
554
- className = { classNames ( `${ prefixCls } -next` , {
555
+ className = { classNames ( `${ prefixCls } -next` , paginationClassNames ?. item , {
555
556
[ `${ prefixCls } -disabled` ] : nextDisabled ,
556
557
} ) }
558
+ style = { styles ?. item }
557
559
aria-disabled = { nextDisabled }
558
560
>
559
561
{ next }
Original file line number Diff line number Diff line change @@ -251,8 +251,26 @@ describe('Other props', () => {
251
251
/> ,
252
252
) ;
253
253
const item = container . querySelector ( '.rc-pagination-item' ) ;
254
+ const prev = container . querySelector ( '.rc-pagination-prev' ) ;
255
+ const next = container . querySelector ( '.rc-pagination-next' ) ;
254
256
expect ( item ) . toHaveClass ( 'custom-test' ) ;
257
+ expect ( prev ) . toHaveClass ( 'custom-test' ) ;
258
+ expect ( next ) . toHaveClass ( 'custom-test' ) ;
255
259
expect ( item ) . toHaveStyle ( 'color: red' ) ;
260
+ expect ( prev ) . toHaveStyle ( 'color: red' ) ;
261
+ expect ( next ) . toHaveStyle ( 'color: red' ) ;
262
+ } ) ;
263
+ it ( 'should have 5 items when there are 3 pages and current page is 2' , ( ) => {
264
+ const { container } = render (
265
+ < Pagination
266
+ total = { 15 }
267
+ pageSize = { 5 }
268
+ current = { 2 }
269
+ classNames = { { item : 'custom-test' } }
270
+ /> ,
271
+ ) ;
272
+ const items = container . querySelectorAll ( '.custom-test' ) ;
273
+ expect ( items . length ) . toBe ( 5 ) ;
256
274
} ) ;
257
275
it ( 'should support custom default icon' , ( ) => {
258
276
const nextIcon = ( ) => < span > nextIcon</ span > ;
You can’t perform that action at this time.
0 commit comments