@@ -19,6 +19,9 @@ export default {
19
19
default: false ,
20
20
},
21
21
22
+ /**
23
+ * Indicates if the view is actively used to display an item.
24
+ */
22
25
active: {
23
26
type: Boolean ,
24
27
required: true ,
@@ -53,6 +56,10 @@ export default {
53
56
size () {
54
57
return (this .vscrollData .validSizes [this .id ] && this .vscrollData .sizes [this .id ]) || 0
55
58
},
59
+
60
+ finalActive () {
61
+ return this .active && this .vscrollData .active
62
+ },
56
63
},
57
64
58
65
watch: {
@@ -64,7 +71,7 @@ export default {
64
71
}
65
72
},
66
73
67
- active (value ) {
74
+ finalActive (value ) {
68
75
if (! this .size ) {
69
76
if (value) {
70
77
if (! this .vscrollParent .$_undefinedMap [this .id ]) {
@@ -122,14 +129,12 @@ export default {
122
129
123
130
methods: {
124
131
updateSize () {
125
- if (this .active && this . vscrollData . active ) {
132
+ if (this .finalActive ) {
126
133
if (this .$_pendingSizeUpdate !== this .id ) {
127
134
this .$_pendingSizeUpdate = this .id
128
135
this .$_forceNextVScrollUpdate = null
129
136
this .$_pendingVScrollUpdate = null
130
- if (this .active && this .vscrollData .active ) {
131
- this .computeSize (this .id )
132
- }
137
+ this .computeSize (this .id )
133
138
}
134
139
} else {
135
140
this .$_forceNextVScrollUpdate = this .id
@@ -150,9 +155,11 @@ export default {
150
155
},
151
156
152
157
onVscrollUpdate ({ force }) {
153
- if (! this .active && force) {
158
+ // If not active, sechedule a size update when it becomes active
159
+ if (! this .finalActive && force) {
154
160
this .$_pendingVScrollUpdate = this .id
155
161
}
162
+
156
163
if (this .$_forceNextVScrollUpdate === this .id || force || ! this .size ) {
157
164
this .updateSize ()
158
165
}
0 commit comments