mirror of
https://github.com/romancm/gamebrary
synced 2024-11-14 23:47:08 +00:00
Scroll to top after each search
This commit is contained in:
parent
9a9130fad5
commit
e00a9c13af
1 changed files with 2 additions and 1 deletions
|
@ -20,7 +20,7 @@
|
||||||
from search results already in your list
|
from search results already in your list
|
||||||
</small>
|
</small>
|
||||||
|
|
||||||
<div class="search-results" v-if="filteredResults.length > 0">
|
<div class="search-results" ref="searchResults" v-if="filteredResults.length > 0">
|
||||||
<game-card
|
<game-card
|
||||||
v-for="{ id } in filteredResults"
|
v-for="{ id } in filteredResults"
|
||||||
search-result
|
search-result
|
||||||
|
@ -146,6 +146,7 @@ export default {
|
||||||
this.error = null;
|
this.error = null;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.noResults = this.filteredResults.length === 0;
|
this.noResults = this.filteredResults.length === 0;
|
||||||
|
this.$refs.searchResults.scrollTop = 0;
|
||||||
})
|
})
|
||||||
.catch(({ data }) => {
|
.catch(({ data }) => {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
Loading…
Reference in a new issue