When a value is entered in the input of the autocomplete component I get this warning that I can’t remove…
This is what my input looks like
<Autocomplete
id="cboAdresse"
sx={{ width: 100 + "%", fontFamily: "Poppins Bold" }}
getOptionLabel={(option) =>
typeof option === "string" ? option : option.label
}
filterOptions={(x) => {
return x;
}}
options={lstadresse}
isOptionEqualToValue={(option, value) =>
value.label === option.label
}
autoComplete
includeInputInList
filterSelectedOptions
value={adresse}
noOptionsText="Aucune adresse trouvée"
onChange={(event, newValue) => {
setLstAdresse(
newValue.name ? [newValue.name, ...lstadresse] : lstadresse
);
setAdresse(newValue.name);
if (newValue.name != "") {
setVille(newValue.city);
setCodePostal(newValue.postcode);
}
}}
onInputChange={(event, newInputValue) => {
setInputRue(newInputValue);
}}
renderInput={(params) => (
<div
ref={params.InputProps.ref}
className="login-block__input form_input_white"
>
<input
type="text"
name="adresse"
placeholder="Adresse"
{...params.inputProps}
/>
</div>
)}
/>
We can see that I have integrated the IsOptionEqualToValue parameter without solving the problem. During my research other people have faced this problem and solved it with what I wrote with the IsOptionEqualToValue. If anyone has a solution I’m interested. Thanks in advance.