search-input runtime-error fix

This commit is contained in:
daviddeepan 2024-04-15 19:54:33 +05:30
parent 2a9060bd39
commit 09c07e58e6

View file

@ -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) => {