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 {
107107
108108 if ( changeSize && Select ) {
109109 const options = pageSizeOptions . map ( ( opt , i ) => (
110- < Select . Option key = { i } value = { opt } >
110+ < Select . Option key = { i } value = { opt . toString ( ) } >
111111 { ( buildOptionText || this . buildOptionText ) ( opt ) }
112112 </ Select . Option >
113113 ) ) ;
@@ -122,7 +122,7 @@ class Options extends React.Component {
122122 dropdownMatchSelectWidth = { false }
123123 value = { ( pageSize || pageSizeOptions [ 0 ] ) . toString ( ) }
124124 onChange = { this . changeSize }
125- getPopupContainer = { ( triggerNode ) => triggerNode . parentNode }
125+ getPopupContainer = { triggerNode => triggerNode . parentNode }
126126 >
127127 { options }
128128 </ Select >
Original file line number Diff line number Diff line change @@ -64,4 +64,19 @@ describe('Pagination with sizer', () => {
6464 expect ( onChange ) . toBeCalled ( ) ;
6565 expect ( onChange ) . toHaveBeenLastCalledWith ( 1 , 10 ) ;
6666 } ) ;
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+ } ) ;
6782} ) ;
You can’t perform that action at this time.
0 commit comments