Blueprints: Set blueprintSearchInput as undefined with empty string
This dispatches changes to `blueprintSearchInput` and sets it as `undefined` when the value is an empty string.
This commit is contained in:
parent
e051aa3f7f
commit
49162e01f5
1 changed files with 5 additions and 1 deletions
|
|
@ -168,7 +168,11 @@ const BlueprintSearch = ({ blueprintsTotal }: blueprintSearchProps) => {
|
|||
};
|
||||
}, [debouncedSearch]);
|
||||
const onChange = (value: string) => {
|
||||
debouncedSearch(value);
|
||||
if (value.length === 0) {
|
||||
dispatch(setBlueprintSearchInput(undefined));
|
||||
} else {
|
||||
debouncedSearch(value);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue