search-input runtime-error fix
This commit is contained in:
parent
2a9060bd39
commit
09c07e58e6
1 changed files with 5 additions and 2 deletions
|
@ -56,8 +56,11 @@ export default function SearchInput(props: Iprops) {
|
|||
const [value, setValue] = useState<SearchOption>(null);
|
||||
const appContext = useContext(AppContext);
|
||||
const handleChange = (value: SearchOption) => {
|
||||
setValue(value);
|
||||
setQuery(value.label);
|
||||
if (value) {
|
||||
setValue(value);
|
||||
setQuery(value.label);
|
||||
}
|
||||
|
||||
blur();
|
||||
};
|
||||
const handleInputChange = (value: string, actionMeta: InputActionMeta) => {
|
||||
|
|
Loading…
Reference in a new issue