Reset pagination on search, scroll into view when paginating search.

This commit is contained in:
DebaucheryLibrarian 2021-08-23 02:38:16 +02:00
parent 0cbb985945
commit f0a6e80e5a
2 changed files with 7 additions and 2 deletions

View File

@ -58,6 +58,8 @@ async function searchMovies() {
this.movies = movies;
this.totalCount = totalCount;
this.$refs.tiles.scrollIntoView();
}
async function mounted() {
@ -76,7 +78,7 @@ export default {
return {
movies: [],
totalCount: 0,
limit: 30,
limit: 5,
};
},
watch: {

View File

@ -20,7 +20,10 @@
<script>
function search(typing) {
if (!typing || this.eager) {
this.$router.replace({ query: { query: this.query || undefined } });
this.$router.replace({
query: { query: this.query || undefined },
params: { ...this.$route.params, pageNumber: 1 },
});
}
}