Skip to content

Commit e401afd

Browse files
Added option to reset the infinite loader
When using the infinite scroll there is no ability to reset the scroll element. This can be useful when you are using the infinite scroll list to show results based on filters. If you apply filter A and scroll till the end the message no more data is shown. But if you also apply filter B then you will reset the list and also the messages that there are either no results or no more data.
1 parent 1762d37 commit e401afd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/InfiniteLoading.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@
9292
this.isNoMore = true;
9393
this.scrollParent.removeEventListener('scroll', this.scrollHandler);
9494
},
95+
'$InfiniteLoading:reset'() {
96+
this.isLoading = false;
97+
this.isNoMore = false;
98+
this.isNoResults = false;
99+
this.scrollParent.addEventListener('scroll', this.scrollHandler);
100+
},
95101
},
96102
destroyed() {
97103
if (!this.isNoResults && !this.isNoMore) {

0 commit comments

Comments
 (0)