fmoo / react-typeahead

Pure react-based typeahead and typeahead-tokenizer
ISC License
677 stars 232 forks source link

inputProps={{value: this.props.value}} :( #179

Open export-mike opened 8 years ago

export-mike commented 8 years ago

Doesn't update text field as its only read on getInitialState, just want to clear my input after submitting a form. I'll keep this here I may contribute next week with a PR. but if you have any quick wins let me know!

export-mike commented 8 years ago

intermediate solution to get the job done use refs and call this.refs.field.setState({ entryValue: ' ' });

nikhilaravi commented 8 years ago

@export-mike I'm having the same problem! I've used your temp solution for now and it works!

export-mike commented 8 years ago

@nikhilaravi can you try out, this beta version we're currently working on: npm i react-typeahead@2.0.0-alpha.1

zalbiraw commented 8 years ago

I am running into this problem as well, and I have tried it with alpha 1 and 2

export-mike commented 8 years ago

you'll have to call refs on this, to have more control. It's not ideal.

Feel free to PR value props mapping to the value of the field, it's all tangled with state at the moment, this code can be simplified.