[material-ui][Autocomplete] Async server filtering not working #41629
Labels
component: autocomplete
This is the name of the generic UI component, not the React module!
package: material-ui
Specific to @mui/material
status: waiting for maintainer
These issues haven't been looked at yet by a maintainer
Search keywords
Autocomplete Async server filtering not working.
Latest version
Steps to reproduce
Link to live example: I cannot provide this since it requires a backend, and I didn't find a free testing one that met my description for the test.
Steps:
4). It does the request but old data stays, while only the filtered requests should show.
Current behavior
Old data is showing with new data on input.
Expected behavior
It should only show new data, aka the current state of customers
Context
I want this autocomplete to be able to filter server side.
Your environment
Hi all, I am making a Autocomplete component that will do server side filtering, so far I got all working but there is one problem
My code:
On input change I fetch new results like so:
So I kinda found what the problem was:
When opening the Autocomplete it will always start off with 14 items, expected behaviour, but when typing in it, it will not remove those items instead it will just add the new items to the existing ones, which is very weird since the customers state is only holding new values.
The only way I found to make the old ones dissapear is by typing in a wrong searchTerm so that nothing gets shown in the dropdown and then backspacing to a correct searchTerm and then it only shows the filtered ones and not the old ones
The text was updated successfully, but these errors were encountered: