@@ -61,7 +61,6 @@ function Overflow<ItemType = any>(
6161 // ================================= Size =================================
6262 function onOverflowResize ( _ : object , element : HTMLElement ) {
6363 setContainerWidth ( element . clientWidth ) ;
64- console . log ( '~~~???>>>' , element . clientWidth , element ) ;
6564 }
6665
6766 function registerSize ( key : React . Key , width : number ) {
@@ -83,7 +82,6 @@ function Overflow<ItemType = any>(
8382
8483 // ================================ Effect ================================
8584 React . useLayoutEffect ( ( ) => {
86- console . log ( 'Effect >>>' , containerWidth , itemWidths , overflowWidth ) ;
8785 if ( containerWidth && overflowWidth && data ) {
8886 let totalWidth = 0 ;
8987
@@ -92,16 +90,6 @@ function Overflow<ItemType = any>(
9290 for ( let i = 0 ; i < len ; i += 1 ) {
9391 const itemWidth = itemWidths . get ( getKey ( data [ i ] , i ) ) || 0 ;
9492 totalWidth += itemWidth ;
95- console . log (
96- i ,
97- '>>>' ,
98- totalWidth ,
99- itemWidth ,
100- overflowWidth ,
101- '|' ,
102- totalWidth + overflowWidth ,
103- containerWidth ,
104- ) ;
10593
10694 if ( totalWidth + overflowWidth > containerWidth ) {
10795 setDisplayCount ( i - 1 ) ;
@@ -122,6 +110,7 @@ function Overflow<ItemType = any>(
122110
123111 return (
124112 < Item < ItemType >
113+ order = { index }
125114 key = { key }
126115 item = { item }
127116 prefixCls = { itemPrefixCls }
@@ -134,9 +123,11 @@ function Overflow<ItemType = any>(
134123 ) ;
135124 } ) }
136125
126+ { /* Rest Count Item */ }
137127 < Item
128+ order = { displayCount }
138129 prefixCls = { itemPrefixCls }
139- className = { `${ itemPrefixCls } -overflow ` }
130+ className = { `${ itemPrefixCls } -rest ` }
140131 disabled = { disabled }
141132 registerSize = { registerOverflowSize }
142133 >
0 commit comments