|
|
@@ -12,6 +12,8 @@ export default class SearchForm extends React.Component {
|
|
|
};
|
|
|
|
|
|
this.handleChange = this.handleChange.bind(this);
|
|
|
+ this.handleFocus = this.handleFocus.bind(this);
|
|
|
+ this.handleBlur = this.handleBlur.bind(this);
|
|
|
this.ticker = null;
|
|
|
}
|
|
|
|
|
|
@@ -34,6 +36,14 @@ export default class SearchForm extends React.Component {
|
|
|
this.search();
|
|
|
}
|
|
|
|
|
|
+ handleFocus(event) {
|
|
|
+ this.props.isShown(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ handleBlur(event) {
|
|
|
+ //this.props.isShown(false);
|
|
|
+ }
|
|
|
+
|
|
|
handleChange(event) {
|
|
|
const keyword = event.target.value;
|
|
|
this.setState({keyword});
|
|
|
@@ -52,6 +62,8 @@ export default class SearchForm extends React.Component {
|
|
|
placeholder="Search ..."
|
|
|
name="q"
|
|
|
value={this.state.keyword}
|
|
|
+ onFocus={this.handleFocus}
|
|
|
+ onBlur={this.handleBlur}
|
|
|
onChange={this.handleChange}
|
|
|
/>
|
|
|
<span className="input-group-btn">
|
|
|
@@ -66,6 +78,7 @@ export default class SearchForm extends React.Component {
|
|
|
|
|
|
SearchForm.propTypes = {
|
|
|
onSearchFormChanged: React.PropTypes.func.isRequired,
|
|
|
+ isShown: React.PropTypes.func.isRequired,
|
|
|
pollInterval: React.PropTypes.number,
|
|
|
};
|
|
|
SearchForm.defaultProps = {
|