Skip to content

Commit 21151d1

Browse files
committed
fix: No responsive when no data
1 parent bd81c22 commit 21151d1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Overflow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function Overflow<ItemType = any>(
6666
const mergedRestWidth = Math.max(prevRestWidth, restWidth);
6767

6868
// ================================= Data =================================
69-
const isResponsive = maxCount === RESPONSIVE;
69+
const isResponsive = data.length && maxCount === RESPONSIVE;
7070

7171
/**
7272
* When is `responsive`, we will always render rest node to get the real width of it for calculation

tests/responsive.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('Overflow.Responsive', () => {
208208
wrapper.initSize(20, 20);
209209
wrapper.setProps({ data: [] });
210210

211-
expect(wrapper.findRest().props().order).toEqual(Number.MAX_SAFE_INTEGER);
211+
expect(wrapper.findRest()).toHaveLength(0);
212212
expect(wrapper.findSuffix().props().style.position).toBeFalsy();
213213
});
214214
});

0 commit comments

Comments
 (0)