diff --git a/src/Selector/index.tsx b/src/Selector/index.tsx index c93af0ce4..50c46f44e 100644 --- a/src/Selector/index.tsx +++ b/src/Selector/index.tsx @@ -186,6 +186,9 @@ const Selector: React.RefForwardingComponent = } if ((mode !== 'combobox' && (!showSearch || !inputMouseDown)) || !open) { + if (open) { + onSearch(''); + } onToggleOpen(); } }; diff --git a/tests/Multiple.test.tsx b/tests/Multiple.test.tsx index ae3dc1944..92f352362 100644 --- a/tests/Multiple.test.tsx +++ b/tests/Multiple.test.tsx @@ -279,4 +279,16 @@ describe('Select.Multiple', () => { toggleOpen(wrapper); expect(wrapper.find('.rc-select-selection-placeholder').length).toBeFalsy(); }); + + it('clear input when popup closed', () => { + const wrapper = mount(