|
|
@@ -44,9 +44,6 @@ class SearchTypeahead extends React.Component {
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
- // **MEMO** This doesn't work at this time -- 2019.05.13 Yuki Takei
|
|
|
- // It is needed to use Modal component of react-bootstrap when showing Move/Duplicate/CreateNewPage modals
|
|
|
- // this.typeahead.getInstance().focus();
|
|
|
}
|
|
|
|
|
|
componentWillUnmount() {
|
|
|
@@ -222,6 +219,9 @@ class SearchTypeahead extends React.Component {
|
|
|
renderMenuItemChildren={this.renderMenuItemChildren}
|
|
|
caseSensitive={false}
|
|
|
defaultSelected={defaultSelected}
|
|
|
+ autoFocus={this.props.autoFocus}
|
|
|
+ onBlur={this.props.onBlur}
|
|
|
+ onFocus={this.props.onFocus}
|
|
|
/>
|
|
|
{resetFormButton}
|
|
|
</div>
|
|
|
@@ -244,6 +244,8 @@ SearchTypeahead.propTypes = {
|
|
|
onSearchSuccess: PropTypes.func,
|
|
|
onSearchError: PropTypes.func,
|
|
|
onChange: PropTypes.func,
|
|
|
+ onBlur: PropTypes.func,
|
|
|
+ onFocus: PropTypes.func,
|
|
|
onSubmit: PropTypes.func,
|
|
|
onInputChange: PropTypes.func,
|
|
|
inputName: PropTypes.string,
|
|
|
@@ -252,6 +254,7 @@ SearchTypeahead.propTypes = {
|
|
|
placeholder: PropTypes.string,
|
|
|
keywordOnInit: PropTypes.string,
|
|
|
helpElement: PropTypes.object,
|
|
|
+ autoFocus: PropTypes.bool,
|
|
|
behaviorOfResetBtn: PropTypes.oneOf(['restore', 'clear']),
|
|
|
};
|
|
|
|
|
|
@@ -265,6 +268,7 @@ SearchTypeahead.defaultProps = {
|
|
|
placeholder: '',
|
|
|
keywordOnInit: '',
|
|
|
behaviorOfResetBtn: 'restore',
|
|
|
+ autoFocus: false,
|
|
|
onInputChange: () => {},
|
|
|
};
|
|
|
|