Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Updating items on Infinite scroll now update observed data for ScrollSectionsMixin #1203

Merged
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
8 changes: 7 additions & 1 deletion components/ui/InfiniteScroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</template>

<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import { Component, Mixins, Prop, Watch } from 'vue-property-decorator'
import ScrollSectionsMixin from '~/mixins/scrollBetweenSections'

@Component
Expand All @@ -23,6 +23,12 @@ export default class extends Mixins(ScrollSectionsMixin) {

lastShown: number = Math.min(this.minItems, this.items.length)

@Watch('items')
onItemsChanged (newItems: Array<any>) : void {
this.lastShown = Math.min(this.minItems, newItems.length)
this.$nextTick(() => this.updateObserved())
}

/**
* This methods gets called when the active section changes.
* Inherited from ScrollSectionsMixin
Expand Down