Open divined opened 7 years ago
After any page updates suggestions are opens again (((
Why not focused element show suggestions? Please add rules to showResults:
On my project I use this concept:
isSuggestionOpen
state, and set it to false
by defaulttrue
(via onFocus
props)false
(via onBlur
props)customClasses.results
props, I add this class (just for example): Typeahead__container Typeahead__container--${this.state.isSuggestionOpen ? 'isOpen' : 'isHide'}
and control it via visibility
, opacity
, or display
. It's your option.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:
Click outside must close suggestions.
How to?