Skip to content

Commit

Permalink
Updating items on Infinite scroll now update observed data for Scroll…
Browse files Browse the repository at this point in the history
…SectionsMixin (Qiskit#1203)
  • Loading branch information
korgan00 authored and y4izus committed Dec 10, 2020
1 parent 9af726c commit 4145431
Showing 1 changed file with 7 additions and 1 deletion.
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

0 comments on commit 4145431

Please sign in to comment.