title: react-bootstrap-typeahead How do I trigger a callback (update state) on `Enter` but not when the user is selecting hint?
body: <p>I'm trying to make an input that will allow user to select multiple items. When finished selecting, he can press <code>Enter</code> to push his selections into an array in the state. The input will then clear and be ready for his next set of selections. (Imagine populating a 2-d array quickly). However, with the code below, if the user presses <code>Enter</code> to select the hint, my callback, <code>pushToState</code>, will trigger as it's in <code>onKeyDown</code>. What's the correct way to implement this behavior?</p>
  <pre><code>&lt;Typeahead
    id=&quot;basic-typeahead-multiple&quot;
    labelKey=&quot;name&quot;
    multiple
    onChange={setMultiSelections}
    options={options}
    selected={multiSelections}
    onKeyDown={(event) =&gt; {
      if (event.key === 'Enter') {
        pushToState(multiSelections);
        setMultiSelections([]);
      }
    }}
  /&gt;
  </code></pre>