Commit be2640b3944b80b67ff42573cfbb2d241cfe6c18

Authored by Sergio Crisostomo
1 parent abb2cae6

check for element before using it

Showing 1 changed file with 1 additions and 1 deletions   Show diff stats
src/components/scroll/scroll.vue
@@ -228,8 +228,8 @@ @@ -228,8 +228,8 @@
228 }, 228 },
229 229
230 onScroll() { 230 onScroll() {
231 - if (this.isLoading) return;  
232 const el = this.$refs.scrollContainer; 231 const el = this.$refs.scrollContainer;
  232 + if (this.isLoading || !el) return;
233 const scrollDirection = Math.sign(this.lastScroll - el.scrollTop); // IE has no Math.sign, check that webpack polyfills this 233 const scrollDirection = Math.sign(this.lastScroll - el.scrollTop); // IE has no Math.sign, check that webpack polyfills this
234 const displacement = el.scrollHeight - el.clientHeight - el.scrollTop; 234 const displacement = el.scrollHeight - el.clientHeight - el.scrollTop;
235 235