Is there a way for the Material UI Autocomplete react component to not be case sensitive?
For example, if I have a list item "Movies" I want to be able to search "movies", "MOVIES", "Movies", etc. and have it come up regardless of what letters are capitalized in the search.
This should do the trick. ignoreCase defaults to true. Lowercase everything.
import { createFilterOptions } from '@material-ui/lab/Autocomplete';
const filterOptions = createFilterOptions({
ignoreCase: true,
});
<Autocomplete filterOptions={filterOptions} />
For more information, check out Custom filter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With