From c8d7e954a4c3ae1312c97e093f4772bc7697acea Mon Sep 17 00:00:00 2001 From: jameswilddev Date: Thu, 25 Nov 2021 15:16:12 +0000 Subject: [PATCH] Allow clearing of the filter in a multi select. --- .../index.tsx | 2 +- .../unit.tsx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/index.tsx b/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/index.tsx index 299a6036..32893e29 100644 --- a/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/index.tsx +++ b/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/index.tsx @@ -46,7 +46,7 @@ export const createSearchableMultiSelectChildrenComponent = < ): Instance & { readonly searchableMultiSelectChildren: Introspection } => { const InputComponent = createInputComponent( (value) => value, - (value) => value.trim() || undefined, + (value) => value.trim(), { ...controlStyle, blurredInvalid: { diff --git a/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/unit.tsx b/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/unit.tsx index d9d27278..f7f8c74c 100644 --- a/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/unit.tsx +++ b/components/createSearchableMultiSelectComponent/createSearchableMultiSelectChildrenComponent/unit.tsx @@ -373,9 +373,9 @@ test(`renders as expected without a filter`, () => { `Example Text` ); - expect(inputType.inputComponent.tryParse(``)).toEqual(undefined); + expect(inputType.inputComponent.tryParse(``)).toEqual(``); expect(inputType.inputComponent.tryParse(` \n \r \t `)).toEqual( - undefined + `` ); expect( inputType.inputComponent.tryParse( @@ -1577,9 +1577,9 @@ test(`renders as expected without horizontal padding`, () => { `Example Text` ); - expect(inputType.inputComponent.tryParse(``)).toEqual(undefined); + expect(inputType.inputComponent.tryParse(``)).toEqual(``); expect(inputType.inputComponent.tryParse(` \n \r \t `)).toEqual( - undefined + `` ); expect( inputType.inputComponent.tryParse( @@ -1949,9 +1949,9 @@ test(`renders as expected without vertical padding`, () => { `Example Text` ); - expect(inputType.inputComponent.tryParse(``)).toEqual(undefined); + expect(inputType.inputComponent.tryParse(``)).toEqual(``); expect(inputType.inputComponent.tryParse(` \n \r \t `)).toEqual( - undefined + `` ); expect( inputType.inputComponent.tryParse(