@@ -123,19 +123,21 @@ function Overflow<ItemType = any>(
123123 const mergedRestWidth = Math . max ( prevRestWidth , restWidth ) ;
124124
125125 // ================================= Data =================================
126- const isResponsive = data . length && maxCount === RESPONSIVE ;
126+ const isResponsive = maxCount === RESPONSIVE ;
127+ const shouldResponsive = data . length && isResponsive ;
127128 const invalidate = maxCount === INVALIDATE ;
128129
129130 /**
130131 * When is `responsive`, we will always render rest node to get the real width of it for calculation
131132 */
132133 const showRest =
133- isResponsive || ( typeof maxCount === 'number' && data . length > maxCount ) ;
134+ shouldResponsive ||
135+ ( typeof maxCount === 'number' && data . length > maxCount ) ;
134136
135137 const mergedData = useMemo ( ( ) => {
136138 let items = data ;
137139
138- if ( isResponsive ) {
140+ if ( shouldResponsive ) {
139141 if ( containerWidth === null && fullySSR ) {
140142 items = data ;
141143 } else {
@@ -149,14 +151,14 @@ function Overflow<ItemType = any>(
149151 }
150152
151153 return items ;
152- } , [ data , itemWidth , containerWidth , maxCount , isResponsive ] ) ;
154+ } , [ data , itemWidth , containerWidth , maxCount , shouldResponsive ] ) ;
153155
154156 const omittedItems = useMemo ( ( ) => {
155- if ( isResponsive ) {
157+ if ( shouldResponsive ) {
156158 return data . slice ( mergedDisplayCount + 1 ) ;
157159 }
158160 return data . slice ( mergedData . length ) ;
159- } , [ data , mergedData , isResponsive , mergedDisplayCount ] ) ;
161+ } , [ data , mergedData , shouldResponsive , mergedDisplayCount ] ) ;
160162
161163 // ================================= Item =================================
162164 const getKey = useCallback (
@@ -284,7 +286,7 @@ function Overflow<ItemType = any>(
284286 const displayRest = restReady && ! ! omittedItems . length ;
285287
286288 let suffixStyle : React . CSSProperties = { } ;
287- if ( suffixFixedStart !== null && isResponsive ) {
289+ if ( suffixFixedStart !== null && shouldResponsive ) {
288290 suffixStyle = {
289291 position : 'absolute' ,
290292 left : suffixFixedStart ,
@@ -294,7 +296,7 @@ function Overflow<ItemType = any>(
294296
295297 const itemSharedProps = {
296298 prefixCls : itemPrefixCls ,
297- responsive : isResponsive ,
299+ responsive : shouldResponsive ,
298300 component : itemComponent ,
299301 invalidate,
300302 } ;
@@ -389,6 +391,8 @@ function Overflow<ItemType = any>(
389391 { suffix && (
390392 < Item
391393 { ...itemSharedProps }
394+ responsive = { isResponsive }
395+ responsiveDisabled = { ! shouldResponsive }
392396 order = { mergedDisplayCount }
393397 className = { `${ itemPrefixCls } -suffix` }
394398 registerSize = { registerSuffixSize }
@@ -403,7 +407,7 @@ function Overflow<ItemType = any>(
403407
404408 if ( isResponsive ) {
405409 overflowNode = (
406- < ResizeObserver onResize = { onOverflowResize } >
410+ < ResizeObserver onResize = { onOverflowResize } disabled = { ! shouldResponsive } >
407411 { overflowNode }
408412 </ ResizeObserver >
409413 ) ;
0 commit comments