react-search-autocomplete icon indicating copy to clipboard operation
react-search-autocomplete copied to clipboard

Question: I would like to know how to differentiate several <ReactSearchAutocomplete /> in a single component

Open pedromaironi opened this issue 2 years ago • 1 comments

I have several inputs inside a form. 3 of them are react-search-autocomplete. So, I had the question how I could identify each combobox. If with an id or a name... I don't want to have to create an OnHandleSearch for that I have created on 5 or 10 forms

  const [state, setState] = useState({
    product: "",
    discount: 0,
    price: 0,
    tax: "",
    description: "",
    amount: 0,
    total: 0,
  });

I'm waiting for manage the autocomplete's components like this
  const handleChange = (e) => {
    setState({
      ...state,
      [e.target.name]: e.target.value,
    });
  };

image

Thank u!

pedromaironi avatar Jul 02 '22 06:07 pedromaironi

Black: <ReactSearchAutocomplete /> Blue: Simple input

pedromaironi avatar Jul 02 '22 06:07 pedromaironi

Sorry, multiple search boxes in one page are not yet supported, there could be some issues.

Anyway this seems more likely an issue with how to manage your code rather than how to use the component itself. Also I'm not a 100% sure what the problem is 🤔

sickdyd avatar Sep 25 '22 00:09 sickdyd