You have right ng-style isn’t neccesary. Yes, all stuff with loading data work correctly. There is only problem with displaying data.
1, 2, 4 appear, when I test app in the browser.
3 exists only on my device ( LG Swift L5, Android 4.1.2)
What is more:
1 - This could be my mistake with using sub-header with collection-repeat ( or list, generally). Maybe you could look at my html directive?
2 - This is evident problem with working collection-repeat and ion-refresher at the same time
3 - This one i strange, maybe it depends on system or device.
4 - This is mistake of collection-repeat’s creator. If I use item with ion-option and I swipe it then I scroll list without swipe againg to hidden, it’ll visible in the next part of list in wrong item.
Has anyone any idea, why I’va got this errors? I’ve checked, that collection-repeat even without sub-header in view hides the first element like on the first screenshot.
you are showing the subheader only if a condition is true (vSearchVisibility).
On your ion-content you set always the class has-header (that should not be necessary, if the real header is always visible).
But you have to add ng-class to you ion-content to add ‘has-subheader’ class if the condition of your subheader is true.
With your code. your ion-content is always behind your subheader, because this class is not set correctly.
I’ve checked your advices and I agree, that ion-content doesn’t need ‘has-header’ class. The point is that even without search bar ( in the subheader) the first element is not visible. So how this class should be set?
I have noticed the same issue - the last card in my listing is rendered blank when using an ion-refresher AND collection repeat directives - similar to
As soon as i remove the ion-refresher things are fine. Digging further, this looks like it is caused in part by the mechanisms that determine ‘beforeSiblings’ and ‘afterSiblings’ in the collection-repeat directive’s rerender function.
I am not at all saying below is the way to fix this - but I can get things to be fine if i modify the beforeSiblings push logic in the rerender function:
function rerender(value) {
var beforeSiblings = [];
var afterSiblings = [];
var before = true;
forEach(scrollViewContent.children, function(node, i) {
if ( ionic.DomUtil.elementIsDescendant($element[0], node, scrollViewContent) ) {
before = false;
} else {
var width = node.offsetWidth;
var height = node.offsetHeight;
if (width && height) {
var element = jqLite(node);
//CHANGED - don't include a scroll refresher - causes extra an card in listing
if(element[0].className !== "scroll-refresher"){
(before ? beforeSiblings : afterSiblings).push({
width: node.offsetWidth,
height: node.offsetHeight,
element: element,
scope: element.isolateScope() || element.scope(),
isOutside: true
});
}
}
}
});
scrollView.resize();
dataSource.setData(value, beforeSiblings, afterSiblings);
collectionRepeatManager.resize();
}