Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Refix auto-completer open / close
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Mar 11, 2016
1 parent fa09e7d commit 11d69a7
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 3 additions & 0 deletions core/src/plugins/action.share/res/react-share-form.css
Expand Up @@ -373,6 +373,9 @@ div.react-autosuggest .react-autosuggest__suggestions {
width: 370px;
z-index: 20;
}
.list-force-hide div.react-autosuggest .react-autosuggest__suggestions {
display: none !important;
}
div.react-autosuggest input#users-autosuggest {
font-size: 18px;
padding-bottom: 9px !important;
Expand Down
3 changes: 3 additions & 0 deletions core/src/plugins/action.share/res/react-share-form.less
Expand Up @@ -394,6 +394,9 @@ div.react-autosuggest {
position: absolute;
width: @width0;
z-index: 20;
.list-force-hide &{
display: none !important;
}
}
input#users-autosuggest {
font-size: 18px;
Expand Down
Expand Up @@ -74,7 +74,6 @@
this.setState({showComplete: false}, function(){
global.setTimeout(function(){
this.refs['autosuggest'].refs['input'].getDOMNode().blur();
this.setState({showComplete: true});
}.bind(this), 10);
});
}
Expand Down Expand Up @@ -123,15 +122,17 @@
name: 'users-autosuggest',
className: 'react-autosuggest__input',
placeholder: this.props.fieldLabel,
onBlur: event => this.setState({showComplete:false}),
onFocus: event => this.setState({showComplete:true}),
value: '' // Initial value
};
return (
<div style={{position:'relative'}} className={this.props.className}>
<div style={{position:'relative'}} className={this.props.className + (this.state.showComplete ? '':' list-force-hide')}>
<span className="suggest-search icon-search"/>
<ReactAutoSuggest
ref="autosuggest"
cache={false}
showWhen = {input => this.state.showComplete }
showWhen = {input => true }
inputAttributes={inputAttributes}
suggestions={this.getSuggestions}
suggestionRenderer={this.props.renderSuggestion}
Expand Down

0 comments on commit 11d69a7

Please sign in to comment.