diff --git a/ui/app/mixins/searchable.js b/ui/app/mixins/searchable.js index 180e4e1b3..0dfa9ba3e 100644 --- a/ui/app/mixins/searchable.js +++ b/ui/app/mixins/searchable.js @@ -36,6 +36,16 @@ export default Mixin.create({ fuzzySearchEnabled: false, regexEnabled: true, + // Search should reset pagination. Not every instance of + // search will be paired with pagination, but it's still + // preferable to generalize this rather than risking it being + // forgotten on a single page. + resetPagination() { + if (this.get('currentPage') != null) { + this.set('currentPage', 1); + } + }, + fuse: computed('listToSearch.[]', 'fuzzySearchProps.[]', function() { return new Fuse(this.get('listToSearch'), { shouldSort: true,