react-typeahead-component icon indicating copy to clipboard operation
react-typeahead-component copied to clipboard

Preventing close (or default behaviour in general)

Open kujon opened this issue 10 years ago • 0 comments

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?

kujon avatar Mar 22 '16 14:03 kujon