diff --git a/src/Selector/MultipleSelector.tsx b/src/Selector/MultipleSelector.tsx index e6a2643f..751ae1b7 100644 --- a/src/Selector/MultipleSelector.tsx +++ b/src/Selector/MultipleSelector.tsx @@ -188,6 +188,10 @@ const SelectSelector: React.FC = (props) => { }; const renderRest = (omittedValues: DisplayValueType[]) => { + // https://github.com/ant-design/ant-design/issues/48930 + if (!values.length) { + return null; + } const content = typeof maxTagPlaceholder === 'function' ? maxTagPlaceholder(omittedValues) diff --git a/tests/Tags.test.tsx b/tests/Tags.test.tsx index 305380c6..944f486a 100644 --- a/tests/Tags.test.tsx +++ b/tests/Tags.test.tsx @@ -323,6 +323,20 @@ describe('Select.Tags', () => { }); }); + // https://github.com/ant-design/ant-design/issues/48930 + it('should not call tagRender when value is empty', () => { + const tagRender = jest.fn(); + render( +