Add onChange hook to the search-box component
This commit is contained in:
parent
b0ddc03409
commit
a82c9d4d6f
|
@ -12,6 +12,9 @@ export default Component.extend({
|
|||
// Used to throttle sets to searchTerm
|
||||
debounce: 150,
|
||||
|
||||
// A hook that's called when the search value changes
|
||||
onChange() {},
|
||||
|
||||
classNames: ['search-box', 'field', 'has-addons'],
|
||||
|
||||
actions: {
|
||||
|
@ -23,5 +26,7 @@ export default Component.extend({
|
|||
});
|
||||
|
||||
function updateSearch() {
|
||||
this.set('searchTerm', this.get('_searchTerm'));
|
||||
const newTerm = this.get('_searchTerm');
|
||||
this.onChange(newTerm);
|
||||
this.set('searchTerm', newTerm);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue