diff --git a/src/components/HeaderSearch/index.js b/src/components/HeaderSearch/index.js index 95d946c02d2d055f575f733ba48c22bdb5f2dc50..2c56fe387d286c7a9b860bac9c9d6560fb4fb697 100644 --- a/src/components/HeaderSearch/index.js +++ b/src/components/HeaderSearch/index.js @@ -11,6 +11,7 @@ export default class HeaderSearch extends PureComponent { className: PropTypes.string, placeholder: PropTypes.string, onSearch: PropTypes.func, + onChange: PropTypes.func, onPressEnter: PropTypes.func, defaultActiveFirstOption: PropTypes.bool, dataSource: PropTypes.array, @@ -22,6 +23,7 @@ export default class HeaderSearch extends PureComponent { defaultActiveFirstOption: false, onPressEnter: () => {}, onSearch: () => {}, + onChange: () => {}, className: '', placeholder: '', dataSource: [], @@ -61,10 +63,13 @@ export default class HeaderSearch extends PureComponent { }; onChange = value => { - const { onChange } = this.props; + const { onSearch, onChange } = this.props; this.setState({ value }); - if (onChange) { - onChange(value); + if (onSearch){ + onSearch(value); + } + if (onChange){ + onChange(value); } };