Commit badb6c42 authored by Michael Lange's avatar Michael Lange
Browse files

Add onChange hook to the search-box component

parent 4b08ef05
Showing with 6 additions and 1 deletion
+6 -1
......@@ -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);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment