sickdyd/react-search-autocomplete

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

Closed this issue · 2 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!

Black: <ReactSearchAutocomplete />
Blue: Simple input

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 🤔