Intersection observer threshold set to 0 & hide button on load
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
<div ref="loadMoreButton" class="button-container">
|
<div ref="loadMoreButton" class="button-container">
|
||||||
<seasoned-button
|
<seasoned-button
|
||||||
class="load-button"
|
class="load-button"
|
||||||
v-if="!shortList && page != totalPages && results.length"
|
v-if="!loading && !shortList && page != totalPages && results.length"
|
||||||
@click="loadMore"
|
@click="loadMore"
|
||||||
:fullWidth="true"
|
:fullWidth="true"
|
||||||
>load more</seasoned-button
|
>load more</seasoned-button
|
||||||
@@ -137,7 +137,7 @@ export default {
|
|||||||
this.observer = new IntersectionObserver(this.handleButtonIntersection, {
|
this.observer = new IntersectionObserver(this.handleButtonIntersection, {
|
||||||
root: this.$refs.resultSection.$el,
|
root: this.$refs.resultSection.$el,
|
||||||
rootMargin: "0px",
|
rootMargin: "0px",
|
||||||
threshold: 1.0
|
threshold: 0
|
||||||
});
|
});
|
||||||
|
|
||||||
this.observer.observe(this.$refs.loadMoreButton);
|
this.observer.observe(this.$refs.loadMoreButton);
|
||||||
|
|||||||
Reference in New Issue
Block a user