Autocomplete does not always display options even if they are available.
Display all options if available.
Steps:
The API is being mocked in the codesandbox with 4 options: "s", "sc", "columbia, s" and "columbia, sc." In my environment it is a remote API call. The issue is consistent with queries to matches (or lack there of) but there doesn't seem to be any reason for which are displayed and which aren't, so far as I can tell.
(Also, sorry about the TypeScript noise in the codesandbox.)


| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.11.0 |
| React | v16.13.1 |
| Browser | Chrome v84.0.4147.89 |
| TypeScript | v3.7.5 |
| Material-UI/lab | ^4.0.0-alpha.55 |
@chanced Thanks for raising this issue. There is a learning gap that we need to fill. What do you think of this diff?
diff --git a/docs/src/pages/components/autocomplete/autocomplete.md b/docs/src/pages/components/autocomplete/autocomplete.md
index ff215c962a..2f5b8fe6b7 100644
--- a/docs/src/pages/components/autocomplete/autocomplete.md
+++ b/docs/src/pages/components/autocomplete/autocomplete.md
@@ -101,6 +101,12 @@ Head to the [customization](#customization) section for an example with the `Aut
{{"demo": "pages/components/autocomplete/Asynchronous.js"}}
+If the logic is fetching new options at each keystroke,
+using the current value of the textbox to filter on the server,
+you need to disable the built-in filtering of the autocomplete component:
+
+```jsx
+<Autocomplete filterOptions={(x) => x} />
+```
+
### Google Maps place
A customized UI for Google Maps Places Autocomplete.
Do you want to work on a pull request? :)
@oliviertassinari thanks! That fixed my issue and that documentation looks good.
Would a warning help? If so, I can look into putting one together and issuing a pull request. Maybe an equality check on options and warn if in dev and filterOptions is not set?
For a warning, I don't see how it could work without false positives. Docs would already be great.
@oliviertassinari ah, fair enough. I was thinking that a ref equality check in comparison to lack of results may work but you're right.
did you just want a pull req of what you wrote? Not sure what I'd work on in terms of a pull request then.
did you just want a pull req of what you wrote? Not sure what I'd work on in terms of a pull request then.
It's a proposal solution. If this would have solved your problem, I think that we should apply it. Do you confirm or infirm?
@oliviertassinari I definitely confirm. It solved my problem, for sure.
Sorry for my confusion.
Most helpful comment
@chanced Thanks for raising this issue. There is a learning gap that we need to fill. What do you think of this diff?
Do you want to work on a pull request? :)