I'm using Material Ui Autocomplete component. So if you write something on that box and then click anywhere outside that input field your input field texts just got cleared out.How can I solve this problem?
import React from 'react';
import TextField from '@material-ui/core/TextField';
import Autocomplete, { createFilterOptions } from '@material-ui/lab/Autocomplete';
export default function Filter() {
return (
<Autocomplete
id="filter-demo"
options={top100Films}
getOptionLabel={(option) => option.title}
filterOptions={x => x}
style={{ width: 300 }}
renderInput={(params) => <TextField {...params} label="Custom filter" variant="outlined" />}
/>
);
}
