|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
import React from 'react';
|
|
|
-
|
|
|
|
|
|
|
+import PropTypes from 'prop-types';
|
|
|
import SearchTypeahead from './SearchTypeahead';
|
|
import SearchTypeahead from './SearchTypeahead';
|
|
|
|
|
|
|
|
// SearchTypeahead wrapper
|
|
// SearchTypeahead wrapper
|
|
@@ -9,7 +9,6 @@ export default class SearchForm extends React.Component {
|
|
|
super(props);
|
|
super(props);
|
|
|
|
|
|
|
|
this.state = {
|
|
this.state = {
|
|
|
- keyword: this.props.keyword,
|
|
|
|
|
searchError: null,
|
|
searchError: null,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
@@ -69,6 +68,7 @@ export default class SearchForm extends React.Component {
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<SearchTypeahead
|
|
<SearchTypeahead
|
|
|
|
|
+ ref = 'searchTypeahead'
|
|
|
crowi={this.props.crowi}
|
|
crowi={this.props.crowi}
|
|
|
onChange={this.onChange}
|
|
onChange={this.onChange}
|
|
|
onSubmit={this.props.onSubmit}
|
|
onSubmit={this.props.onSubmit}
|
|
@@ -76,13 +76,16 @@ export default class SearchForm extends React.Component {
|
|
|
emptyLabel={emptyLabel}
|
|
emptyLabel={emptyLabel}
|
|
|
placeholder="Search ..."
|
|
placeholder="Search ..."
|
|
|
promptText={this.getHelpElement()}
|
|
promptText={this.getHelpElement()}
|
|
|
- keywordOnInit={this.state.keyword}
|
|
|
|
|
|
|
+ keywordOnInit={this.props.keyword}
|
|
|
/>
|
|
/>
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
SearchForm.propTypes = {
|
|
SearchForm.propTypes = {
|
|
|
|
|
+ crowi: PropTypes.object.isRequired,
|
|
|
|
|
+ keyword: PropTypes.string,
|
|
|
|
|
+ onSubmit: PropTypes.func.isRequired,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
SearchForm.defaultProps = {
|
|
SearchForm.defaultProps = {
|