From 5b5df8cdc231f989e7fc6d6677d02e9ef695d1b9 Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Wed, 14 Dec 2022 12:24:16 +0100 Subject: [PATCH] fix: items not updating if new object reference, fix #690 --- .../vue-virtual-scroller/src/components/RecycleScroller.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue index 9aca995e..60c94950 100644 --- a/packages/vue-virtual-scroller/src/components/RecycleScroller.vue +++ b/packages/vue-virtual-scroller/src/components/RecycleScroller.vue @@ -581,7 +581,6 @@ export default { // Assign view to item views.delete(view.nr.key) - view.item = item view.nr.used = true view.nr.index = i view.nr.key = key @@ -601,6 +600,9 @@ export default { } } + // Always set item in case it's a new object with the same key + view.item = item + if (newlyUsedView) { if (i === items.length - 1) this.$emit('scroll-end') if (i === 0) this.$emit('scroll-start')