M
M
Mad Coder2021-01-13 19:13:09
React
Mad Coder, 2021-01-13 19:13:09

How to fix search in Autocomplete Material UI React?

Hello. There is a standard Autocomplete component from React Material UI https://material-ui.com/components/autocomplete/#a... . An array with objects of the type is passed as a list: {id: 1, name: 'Secondary school №1', address: 'City of Ensk, st. Enskaya, 3'}. The name field is passed as a label (getOptionLabel={(option) => option.name}. The question is, when searching, I need a list not only by the name field (which happens by default) but also by the address field.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JavaDev, 2021-01-13
@polyak-y

Use Custom Filter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question