Skip to content

Commit

Permalink
fix(ui): plugin search pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 27, 2018
1 parent 14881ee commit f633a3f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/@vue/cli-ui/src/views/ProjectPluginsAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
api-key="db283631f89b5b8a10707311f911fd00"
index-name="npm-search"
:query-parameters="{
hitsPerPage: 10,
hitsPerPage: 20,
attributesToRetrieve: [
'name',
'description',
Expand All @@ -40,7 +40,7 @@
ref="searchInput"
:placeholder="$t('views.project-plugins-add.tabs.search.search-input')"
/>
<ais-results>
<ais-results ref="results">
<PackageSearchItem
slot-scope="{ result }"
:pkg="result"
Expand All @@ -54,7 +54,7 @@
<div>{{ $t('views.project-plugins-add.tabs.search.not-found') }}</div>
</div>
</ais-no-results>
<InstantSearchPagination/>
<InstantSearchPagination @page-change="scrollResultsToTop()"/>
</ais-index>
</div>

Expand Down Expand Up @@ -309,6 +309,11 @@ export default {
} catch (e) {
console.error(e)
}
},
scrollResultsToTop () {
const vm = this.$refs.results
if (vm) vm.$el.scrollTop = 0
}
}
}
Expand Down

0 comments on commit f633a3f

Please sign in to comment.