Skip to content

Commit 477afa6

Browse files
committed
fix: rest should use origin title logic
1 parent 79acc10 commit 477afa6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/Selector/MultipleSelector.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const SelectSelector: React.FC<SelectorProps> = (props) => {
175175
? maxTagPlaceholder(omittedValues)
176176
: maxTagPlaceholder;
177177

178-
return defaultRenderSelector(content, content, false);
178+
return defaultRenderSelector({ title: content }, content, false);
179179
}
180180

181181
// >>> Input Node

tests/Select.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,18 +1929,21 @@ describe('Select.Basic', () => {
19291929
const wrapper = mount(
19301930
<Select
19311931
mode="multiple"
1932-
value={['b', 'l']}
1932+
value={['b', 'l', 'r']}
1933+
maxTagCount={2}
19331934
options={[
19341935
{ label: 'bamboo', title: 'TitleBamboo', value: 'b' },
19351936
{ label: 'little', value: 'l' },
1937+
{ label: 'Rest', value: 'r' },
19361938
]}
19371939
/>,
19381940
);
19391941

1940-
expect(wrapper.find('.rc-select-selection-item').first().prop('title')).toEqual(
1942+
expect(wrapper.find('span.rc-select-selection-item').at(0).prop('title')).toEqual(
19411943
'TitleBamboo',
19421944
);
1943-
expect(wrapper.find('.rc-select-selection-item').last().prop('title')).toEqual('little');
1945+
expect(wrapper.find('span.rc-select-selection-item').at(1).prop('title')).toEqual('little');
1946+
expect(wrapper.find('span.rc-select-selection-item').at(2).prop('title')).toEqual('+ 1 ...');
19441947
});
19451948
});
19461949
});

0 commit comments

Comments
 (0)