Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/OptionList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const OptionList: React.ForwardRefRenderFunction<RefOptionListProps, OptionListP
// https://github.com/ant-design/ant-design/issues/34975
const isSelected = React.useCallback(
(value: RawValueType) => rawValues.has(value) && mode !== 'combobox',
[mode, [...rawValues].toString()],
[mode, [...rawValues].toString(), rawValues.size],
);

// Auto scroll to item position in single mode
Expand Down
20 changes: 20 additions & 0 deletions tests/Multiple.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -600,5 +600,25 @@ describe('Select.Multiple', () => {
expect(errSpy).not.toHaveBeenCalled();
errSpy.mockRestore();
});

it('selected icon should show when value is empty', () => {
const wrapper = mount(
<Select
mode="multiple"
open
options={[
{
label: 'Bamboo',
value: '',
},
]}
/>,
);
toggleOpen(wrapper);
selectItem(wrapper, 0);
expect(wrapper.find('.rc-select-item-option-state-icon').at(0).text()).toBe('✓');
selectItem(wrapper, 0);
expect(wrapper.find('.rc-select-item-option-state-icon').at(0).text()).toBe('');
});
});
});