Skip to content

Commit af7a03c

Browse files
committed
amend(collectionRepeat): make after container always calculate size correctly
Closes #2376.
1 parent 96e8601 commit af7a03c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

js/angular/directive/collectionRepeat.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ IonicModule
8383

8484
var ONE_PX_TRANSPARENT_IMG_SRC = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
8585
var WIDTH_HEIGHT_REGEX = /height:.*?px;\s*width:.*?px/;
86-
var DEFAULT_RENDER_BUFFER = 10;
86+
var DEFAULT_RENDER_BUFFER = 2;
8787

8888
CollectionRepeatDirective.$inject = ['$ionicCollectionManager', '$parse', '$window', '$$rAF'];
8989
function CollectionRepeatDirective($ionicCollectionManager, $parse, $window, $$rAF) {
@@ -454,8 +454,7 @@ function RepeatManagerFactory($rootScope, $window, $$rAF) {
454454
// Create the pool of items for reuse, setting the size to (estimatedItemsOnScreen) * 2,
455455
// plus the size of the renderBuffer.
456456
if (!isLayoutReady) {
457-
var poolSize = 2 * view.scrollPrimarySize /
458-
view.estimatedPrimarySize * view.estimatedItemsAcross + (renderBuffer * 2);
457+
var poolSize = Math.max(20, renderBuffer * 3);
459458
for (var i = 0; i < poolSize; i++) {
460459
itemsPool.push(new RepeatItem());
461460
}

scss/_util.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,8 @@
279279
}
280280
.collection-repeat-after-container {
281281
z-index: 0;
282-
&.horizontal {
282+
display: block;
283+
&.vertical {
283284
display: inline-block;
284285
}
285286
}

0 commit comments

Comments
 (0)