PeachScript / vue-infinite-loading

An infinite scroll plugin for Vue.js.
https://peachscript.github.io/vue-infinite-loading/
MIT License
2.66k stars 366 forks source link

vue-infinite-loading keep calling again and again without scrolling also #309

Closed nipunupekshana closed 3 years ago

nipunupekshana commented 3 years ago

I have a issue when using vue-infinite-loading component in my Vue Application

when i open collapsable component then it will run the vue-infinite-loading & after 1st load without scrolling also it will again run vue-infinite-loading, tried with changin distance & used force-use-infinite-wrapper also but still same result. any help? here is my sample code:

` /////method async infiniteHandler($state, state) { this.loadingBroker = true; //check all brokers loaded //let currentTotal = this.result.filter(item => item.key === state.key); console.log($state, $state); console.log(state, state);

  console.log(
    `this.$refs.infiniteLoading.status `,
    this.$refs.infiniteLoading[0].getCurrentDistance
  );
  if (this.result.length !== state.brokersCount) {
    if (this.result.length) {
      this.BrokersSearch.skip =
        this.BrokersSearch.skip + this.BrokersSearch.top;
    }
    await this.fetchBrokers(state.key, true);
    $state.loaded();
  } else {
    $state.complete();
  }
  this.loadingBroker = false;
},

`