File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ class Options extends React.Component {
107
107
108
108
if ( changeSize && Select ) {
109
109
const options = pageSizeOptions . map ( ( opt , i ) => (
110
- < Select . Option key = { i } value = { opt } >
110
+ < Select . Option key = { i } value = { opt . toString ( ) } >
111
111
{ ( buildOptionText || this . buildOptionText ) ( opt ) }
112
112
</ Select . Option >
113
113
) ) ;
@@ -122,7 +122,7 @@ class Options extends React.Component {
122
122
dropdownMatchSelectWidth = { false }
123
123
value = { ( pageSize || pageSizeOptions [ 0 ] ) . toString ( ) }
124
124
onChange = { this . changeSize }
125
- getPopupContainer = { ( triggerNode ) => triggerNode . parentNode }
125
+ getPopupContainer = { triggerNode => triggerNode . parentNode }
126
126
>
127
127
{ options }
128
128
</ Select >
Original file line number Diff line number Diff line change @@ -64,4 +64,19 @@ describe('Pagination with sizer', () => {
64
64
expect ( onChange ) . toBeCalled ( ) ;
65
65
expect ( onChange ) . toHaveBeenLastCalledWith ( 1 , 10 ) ;
66
66
} ) ;
67
+
68
+ // https://github.com/ant-design/ant-design/issues/26580
69
+ it ( 'should contains locale text in selected pageSize when pageSizeOptions are numbers' , ( ) => {
70
+ const wrapper = mount (
71
+ < Pagination
72
+ selectComponentClass = { Select }
73
+ total = { 500 }
74
+ defaultPageSize = { 20 }
75
+ pageSizeOptions = { [ 20 , 50 ] }
76
+ /> ,
77
+ ) ;
78
+ expect ( wrapper . find ( Select ) . find ( '.rc-select-selection-item' ) . text ( ) ) . toBe (
79
+ '20 条/页' ,
80
+ ) ;
81
+ } ) ;
67
82
} ) ;
You can’t perform that action at this time.
0 commit comments