From c87a8f9c05be6a5b7467f34a160a8c616b075ca6 Mon Sep 17 00:00:00 2001 From: AlbertAZ1992 Date: Thu, 2 Jul 2020 18:59:39 +0800 Subject: [PATCH 1/2] fix: trigger search after input value onchanged --- src/Selector/index.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Selector/index.tsx b/src/Selector/index.tsx index 7dc36c7a5..45a2b58e4 100644 --- a/src/Selector/index.tsx +++ b/src/Selector/index.tsx @@ -189,9 +189,8 @@ const Selector: React.RefForwardingComponent = pasteClearRef.current = true; setTimeout(() => { pasteClearRef.current = false; + triggerOnSearch(value); }); - - triggerOnSearch(value); }; // ====================== Focus ====================== From 62dcd1ae9a3d850f806fa63786946741ce116abd Mon Sep 17 00:00:00 2001 From: AlbertAZ1992 Date: Thu, 2 Jul 2020 20:48:00 +0800 Subject: [PATCH 2/2] feat: update select paste async test --- tests/Tags.test.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/Tags.test.tsx b/tests/Tags.test.tsx index b016e1fd4..08a3cae97 100644 --- a/tests/Tags.test.tsx +++ b/tests/Tags.test.tsx @@ -140,7 +140,8 @@ describe('Select.Tags', () => { expectOpen(wrapper, false); }); - it('paste content to split', () => { + it('paste content to split after 100ms', done => { + jest.useFakeTimers(); const onChange = jest.fn(); const wrapper = mount(