This repository was archived by the owner on Mar 21, 2023. It is now read-only.

Description
I tried to use plugin for infinite scroll.
handleScroll(vertical) {
let position = vertical.scrollTop;
const maxHeight = parseInt(getComputedStyle(this.$el).maxHeight, 10);
let getFullHeight = () => {
let fullHeight = 0;
this.$refs.cartItem.forEach(item => {
fullHeight += item.offsetHeight;
});
return fullHeight
};
let fullHeight = getFullHeight();
if (maxHeight + position > fullHeight * 0.9 && this.pagination.hasNext && !this.loading) {
this.waitForLoadMore = true;
this.$emit('get-more', () => {
fullHeight = getFullHeight();
this.waitForLoadMore = false;
this.$refs.scroller.refresh();
});
}
},
callback into get-more emitter will execute after pushing new items in array.
If I scroll by mouse it's ok, but when i drag and move bar down too fast, plugin set scroll position to top (without calling scrollTo()) and i get an error:
Uncaught TypeError: Cannot read property 'parentNode' of undefined
at HTMLDocument.mousemove
1057:
var thubmParent = ctx.$refs.thumb (err undefined) .parentNode;
template:
<vue-scroll :ops="scrollOptions" @handle-scroll="handleScroll" ref="scroller">
<div class="c-scroll promo-content__scroll-area cart-list">
<div slot="scroll-content" name="container"> cutted inner markup </div>
</div>
</vue-scroll>