Skip to content

Commit

Permalink
Fixed: the case where loading label is not displayed when infinite sc…
Browse files Browse the repository at this point in the history
…rolling(#289)
  • Loading branch information
R-Sourabh committed Apr 20, 2024
1 parent 714054b commit 51ea33b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/components/ProductFilterModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<ion-icon :icon="checkmarkOutline" />
</ion-fab-button>
</ion-fab>
<ion-infinite-scroll @ionInfinite="loadMoreTags($event)" threshold="100px" v-show="isScrollingEnabled && isScrollable" ref="infiniteScrollRef">
<ion-infinite-scroll @ionInfinite="loadMoreTags($event)" threshold="100px" v-show="isScrollable" ref="infiniteScrollRef">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="$t('Loading')"/>
</ion-infinite-scroll>
</ion-content>
Expand Down Expand Up @@ -150,6 +150,10 @@ export default defineComponent({
}
},
async loadMoreTags(event: any){
// Added this check here as if added on infinite-scroll component the Loading content does not gets displayed
if(!(this.isScrollingEnabled && this.isScrollable)) {
await event.target.complete();
}
this.getTags(
undefined,
Math.ceil(this.facetOptions.length / process.env.VUE_APP_VIEW_SIZE).toString()
Expand Down
6 changes: 5 additions & 1 deletion src/views/SelectProduct.vue
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
If we do not define an extra variable and just use v-show to check for `isScrollable` then when coming back to the page infinite-scroll is called programatically.
We have added an ionScroll event on ionContent to check whether the infiniteScroll can be enabled or not by toggling the value of isScrollingEnabled whenever the height < 0.
-->
<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" v-show="isScrollingEnabled && isScrollable" ref="infiniteScrollRef">
<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px" v-show="isScrollable" ref="infiniteScrollRef">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="$t('Loading')"/>
</ion-infinite-scroll>
</main>
Expand Down Expand Up @@ -354,6 +354,10 @@ export default defineComponent({
}
},
async loadMoreProducts(event: any){
// Added this check here as if added on infinite-scroll component the Loading content does not gets displayed
if(!(this.isScrollingEnabled && this.isScrollable)) {
await event.target.complete();
}
this.getProducts(
undefined,
Math.ceil(this.products.list.length / process.env.VUE_APP_VIEW_SIZE).toString()
Expand Down

0 comments on commit 51ea33b

Please sign in to comment.