Skip to content

Commit

Permalink
Allow clearing of the filter in a multi select.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswilddev committed Nov 25, 2021
1 parent 242381e commit c8d7e95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const createSearchableMultiSelectChildrenComponent = <
): Instance<T> & { readonly searchableMultiSelectChildren: Introspection } => {
const InputComponent = createInputComponent<string, null>(
(value) => value,
(value) => value.trim() || undefined,
(value) => value.trim(),
{
...controlStyle,
blurredInvalid: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit c8d7e95

Please sign in to comment.