From 34903a88c48a9e460102432c015e4d7ce18cdc93 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 22 Oct 2022 19:03:42 +0800 Subject: [PATCH] fix: Select should show selected icon when value is '' (#847) close https://github.com/ant-design/ant-design/issues/38150 --- src/OptionList.tsx | 2 +- tests/Multiple.test.tsx | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/OptionList.tsx b/src/OptionList.tsx index 09e39bd65..22fb4e7b3 100644 --- a/src/OptionList.tsx +++ b/src/OptionList.tsx @@ -120,7 +120,7 @@ const OptionList: React.ForwardRefRenderFunction rawValues.has(value) && mode !== 'combobox', - [mode, [...rawValues].toString()], + [mode, [...rawValues].toString(), rawValues.size], ); // Auto scroll to item position in single mode diff --git a/tests/Multiple.test.tsx b/tests/Multiple.test.tsx index ea143a831..8ef15bf49 100644 --- a/tests/Multiple.test.tsx +++ b/tests/Multiple.test.tsx @@ -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( +