Skip to content

Commit 947f6db

Browse files
author
Guillaume Chau
committed
fix(dynamic scroller): update state now depends on id
1 parent dc21471 commit 947f6db

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/components/DynamicScrollerItem.vue

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default {
5959
},
6060
6161
active (value) {
62-
if (value && this.$_pendingVScrollUpdate) {
62+
if (value && this.$_pendingVScrollUpdate === this.id) {
6363
this.updateSize()
6464
}
6565
},
@@ -68,7 +68,7 @@ export default {
6868
created () {
6969
if (this.$isServer) return
7070
71-
this.$_forceNextVScrollUpdate = false
71+
this.$_forceNextVScrollUpdate = null
7272
this.updateWatchData()
7373
7474
for (const k in this.sizeDependencies) {
@@ -93,16 +93,16 @@ export default {
9393
methods: {
9494
updateSize () {
9595
if (this.active && this.vscrollData.active) {
96-
if (!this.$_pendingSizeUpdate) {
97-
this.$_pendingSizeUpdate = true
98-
this.$_forceNextVScrollUpdate = false
99-
this.$_pendingVScrollUpdate = false
96+
if (this.$_pendingSizeUpdate !== this.id) {
97+
this.$_pendingSizeUpdate = this.id
98+
this.$_forceNextVScrollUpdate = null
99+
this.$_pendingVScrollUpdate = null
100100
if (this.active && this.vscrollData.active) {
101101
this.computeSize(this.id)
102102
}
103103
}
104104
} else {
105-
this.$_forceNextVScrollUpdate = true
105+
this.$_forceNextVScrollUpdate = this.id
106106
}
107107
},
108108
@@ -125,9 +125,9 @@ export default {
125125
126126
onVscrollUpdate ({ force }) {
127127
if (!this.active && force) {
128-
this.$_pendingVScrollUpdate = true
128+
this.$_pendingVScrollUpdate = this.id
129129
}
130-
if (this.$_forceNextVScrollUpdate || force || !this.height) {
130+
if (this.$_forceNextVScrollUpdate === this.id || force || !this.height) {
131131
this.updateSize()
132132
}
133133
},
@@ -149,7 +149,7 @@ export default {
149149
if (this.emitResize) this.$emit('resize', this.id)
150150
}
151151
}
152-
this.$_pendingSizeUpdate = false
152+
this.$_pendingSizeUpdate = null
153153
})
154154
},
155155
},

0 commit comments

Comments
 (0)