react-typeahead
                                
                                
                                
                                    react-typeahead copied to clipboard
                            
                            
                            
                        Click outside must close suggestions.
Click outside must close suggestions.
How to?
After any page updates suggestions are opens again (((
Why not focused element show suggestions? Please add rules to showResults:
- entryValue in_array searchResults and searchResults.length == 1 > hide
 - isFocused == false > hide
 
On my project I use this concept:
- create 
isSuggestionOpenstate, and set it tofalseby default - while user focus on input, set that state to 
true(viaonFocusprops) - if user click outside input, set that state to 
false(viaonBlurprops) - in 
customClasses.resultsprops, I add this class (just for example):Typeahead__container Typeahead__container--${this.state.isSuggestionOpen ? 'isOpen' : 'isHide'}and control it viavisibility,opacity, ordisplay. It's your option. - it works for me. May help you :)
 
simiply, we can set showResults to false on _onBlur Function
this.setState({isFocused: false, showResults: false}, function () {
instead of just,
this.setState({isFocused: false }, function () {
it works with me :smile: