File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change 133
133
return
134
134
}
135
135
136
- delta . end = zone . end
137
- delta . start = zone . start
138
- this . $forceUpdate ( )
136
+ // we'd better make sure calls as less as possible.
137
+ if ( zone . start !== delta . start || zone . end !== delta . end ) {
138
+ delta . end = zone . end
139
+ delta . start = zone . start
140
+ this . forceRender ( )
141
+ }
142
+ } ,
143
+
144
+ // force render ui list if we needed.
145
+ // call this before the next repaint to get better performance.
146
+ forceRender ( ) {
147
+ var that = this
148
+ window . requestAnimationFrame ( function ( ) {
149
+ that . $forceUpdate ( )
150
+ } )
139
151
} ,
140
152
141
153
// return the scroll passed items count in variable.
358
370
this . alter = ''
359
371
delta . end = zone . end
360
372
delta . start = zone . start
361
- this . $forceUpdate ( )
373
+ this . forceRender ( )
362
374
}
363
375
} ,
364
376
You can’t perform that action at this time.
0 commit comments