Skip to content
Snippets Groups Projects
Commit 3c76fd62 authored by schneider210's avatar schneider210
Browse files

fix: scroll to top after using the pagination

parent 166feb38
No related branches found
No related tags found
1 merge request!59Search hitlist: Scroll to top when going to next page
Pipeline #218710 passed
......@@ -5,14 +5,19 @@
v-if="total > 0"
class="text-overline mb-0"
>{{total}} Results</p>
<SearchResultList :items="items" />
<div class="text-center">
<div
class="text-center"
@click="scrollUp()"
>
<v-pagination
v-if="items.length > 0"
v-model="page"
:length="pagesAmount"
:total-visible="7"
></v-pagination>
/>
</div>
</div>
</template>
......@@ -71,9 +76,16 @@ export default {
this.items = items.map(x=>({...x, searchTerm: value}));
}
}
}
}
}
},
scrollUp() {
window.scrollTo({
top: 0,
left: 0,
behavior: 'smooth',
});
},
},
};
</script>
<style scoped>
......
......@@ -10,7 +10,7 @@
<a :href="getItemUrl(item)" target="_blank">
<v-list-item-title>{{item.label}}</v-list-item-title>
<v-list-item-subtitle class="d-flex">
<span v-for="(matchItem, i) in item.matches" class="d-flex">
<span v-for="(matchItem, i) in item.matches" :key="i" class="d-flex">
<span>"{{matchItem.match}}"</span>
<span>&nbsp;({{matchItem.occurrencesOnPage}})</span>
<span v-if="i < item.matches.length - 1">, </span>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment