Skip to content

Commit 9bfa3bd

Browse files
committed
fix(collectionRepeat): ignore spacing of hidden elements (ion-refresher)
Closes #1970
1 parent 044fac4 commit 9bfa3bd

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

Diff for: js/angular/directive/collectionRepeat.js

+3
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ function($collectionRepeatManager, $collectionDataSource, $parse) {
217217
rerender(value);
218218
});
219219

220+
// Find every sibling before and after the repeated items, and pass them
221+
// to the dataSource
220222
var scrollViewContent = scrollCtrl.scrollView.__content;
221223
function rerender(value) {
222224
var beforeSiblings = [];
@@ -226,6 +228,7 @@ function($collectionRepeatManager, $collectionDataSource, $parse) {
226228
if ( ionic.DomUtil.elementIsDescendant($element[0], node, scrollViewContent) ) {
227229
before = false;
228230
} else {
231+
if (node.hasAttribute('collection-repeat-ignore')) return;
229232
var width = node.offsetWidth;
230233
var height = node.offsetHeight;
231234
if (width && height) {

Diff for: js/angular/directive/refresher.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ IonicModule
6464
replace: true,
6565
require: '^$ionicScroll',
6666
template:
67-
'<div class="scroll-refresher">' +
67+
'<div class="scroll-refresher" collection-repeat-ignore>' +
6868
'<div class="ionic-refresher-content" ' +
6969
'ng-class="{\'ionic-refresher-with-text\': pullingText || refreshingText}">' +
7070
'<div class="icon-pulling">' +

Diff for: test/html/list-fit.html

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ <h1 class="title">Hi</h1>
1818
</a>
1919
</ion-header-bar>
2020
<ion-content>
21+
<ion-refresher on-refresh="loadMore()"></ion-refresher>
2122
<p>
2223
Hi, I'm some text before the list.
2324
</p>
@@ -61,6 +62,7 @@ <h2>{{item.text}}</h2>
6162
var n = 1 + Math.floor(4*Math.random());
6263
for (var i = 0; i < n; i++) addImage();
6364
$scope.$broadcast('scroll.infiniteScrollComplete');
65+
$scope.$broadcast('scroll.refreshComplete');
6466
}, 1500);
6567
};
6668
}

0 commit comments

Comments
 (0)