ezequiel/react-typeahead-component

Preventing close (or default behaviour in general)

kujon opened this issue · 0 comments

kujon commented

First of all - this component is royal awesomeness. Configurability is way beyond anything else.

I've got a slight issue, though: I'm using it for a quick entry mechanism - think freehand text turned into structured data upon selection. When each word is being typed, we're going to give you suggestions as to what it might be (based on what property of the structured data we think you are specifying atm). So, I'd like to be able to select a suggestion and continue typing without dropdown closing down on me. Currently, there's no way to prevent it from closing.

There are 2 solutions that crop into my mind:

  1. event.preventDefault() - pros: the component itself will continue handling open/close state, which makes development a breeze. cons: jQuery-like not react-like.
  2. Make open/close a controlled property - pros: achieve whatever you'd like. cons: much more hassle to get up and running.

Or maybe there's already a configuration and I'm simply missing it?