Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Infinite scroll with searchbar and loading bug #385

Merged
merged 3 commits into from
Apr 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/views/AssignPickerModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<ion-infinite-scroll
@ionInfinite="loadMorePickers($event)"
threshold="100px"
v-show="isScrollingEnabled && isScrollable"
v-show="isScrollable"
ref="infiniteScrollRef"
>
<ion-infinite-scroll-content
Expand Down Expand Up @@ -142,6 +142,10 @@ export default defineComponent({
}
},
async loadMorePickers(event) {
// 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.getPicker(
undefined,
Math.ceil(
Expand Down
6 changes: 5 additions & 1 deletion src/views/Catalog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<ion-infinite-scroll
@ionInfinite="loadMoreProducts($event)"
threshold="100px"
v-show="isScrollingEnabled && isScrollable"
v-show="isScrollable"
ref="infiniteScrollRef"
>
<ion-infinite-scroll-content
Expand Down Expand Up @@ -96,6 +96,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(
Expand Down
6 changes: 5 additions & 1 deletion src/views/Orders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
<ion-refresher-content pullingIcon="crescent" refreshingSpinner="crescent" />
</ion-refresher>
<ion-infinite-scroll @ionInfinite="loadMoreProducts($event)" threshold="100px"
v-show="isScrollingEnabled && (segmentSelected === 'open' ? isOpenOrdersScrollable : segmentSelected === 'packed' ? isPackedOrdersScrollable : isCompletedOrdersScrollable)"
v-show="(segmentSelected === 'open' ? isOpenOrdersScrollable : segmentSelected === 'packed' ? isPackedOrdersScrollable : isCompletedOrdersScrollable)"
ref="infiniteScrollRef">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
Expand Down Expand Up @@ -352,6 +352,10 @@ export default defineComponent({
}
},
async loadMoreProducts (event: any) {
// Added this check here as if added on infinite-scroll component the Loading content does not get displayed
if (!(this.isScrollingEnabled && (this.segmentSelected === 'open' ? this.isOpenOrdersScrollable : this.segmentSelected === 'packed' ? this.isPackedOrdersScrollable : this.isCompletedOrdersScrollable))) {
await event.target.complete();
}
if (this.segmentSelected === 'open') {
this.getPickupOrders(
undefined,
Expand Down
6 changes: 5 additions & 1 deletion src/views/ShipToStoreOrders.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<ion-refresher-content pullingIcon="crescent" refreshingSpinner="crescent" />
</ion-refresher>
<ion-infinite-scroll @ionInfinite="loadMoreOrders($event)" threshold="100px"
v-show="isScrollingEnabled && (segmentSelected === 'incoming' ? isIncomingOrdersScrollable : segmentSelected === 'readyForPickup' ? isReadyForPickupOrdersScrollable : isCompletedOrdersScrollable)"
v-show="(segmentSelected === 'incoming' ? isIncomingOrdersScrollable : segmentSelected === 'readyForPickup' ? isReadyForPickupOrdersScrollable : isCompletedOrdersScrollable)"
ref="infiniteScrollRef">
<ion-infinite-scroll-content loading-spinner="crescent" :loading-text="translate('Loading')" />
</ion-infinite-scroll>
Expand Down Expand Up @@ -227,6 +227,10 @@ export default defineComponent({
}
},
async loadMoreOrders (event: any) {
// Added this check here as if added on infinite-scroll component the Loading content does not gets displayed
if (!(this.isScrollingEnabled && (this.segmentSelected === 'incoming' ? this.isIncomingOrdersScrollable : this.segmentSelected === 'readyForPickup' ? this.isReadyForPickupOrdersScrollable : this.isCompletedOrdersScrollable))) {
await event.target.complete();
}
if (this.segmentSelected === 'incoming') {
this.getIncomingOrders(
undefined,
Expand Down
Loading