[material-ui] [Autocomplete] Add disableSearch
to prevent local search
#45512
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Summary
Hi there,
The Autocomplete component currently lacks the ability to disable its built-in local search functionality.
This behavior becomes problematic in scenarios where backend APIs handle all search and filtering, as it leads to unnecessary processing and potential data discrepancies.
To address this, I suggest introducing a new
disableSearch
prop. When set to true, this prop would completely prevent the component from performing any local search, allowing developers to rely entirely on backend-driven search and filtering logic.This feature would improve performance, ensure data consistency, and provide a more elegant solution compared to workarounds like overriding
filterOptions
.Examples
Scenario:
Motivation
I suggest a new feature for the Autocomplete component: the ability to fully disable local search.
By implementing full support for disableSearch: true, developers can rely entirely on backend search and filtering, improving both performance and data consistency.
Currently, I’m addressing this issue by using:
However, I believe a more elegant solution would be to introduce a dedicated
disableSearch
prop.I’d be happy to open a PR to implement this feature.
Search keywords: Autocomplete, LocalSearch, Input
The text was updated successfully, but these errors were encountered: