Skip to content
This repository has been archived by the owner on May 4, 2022. It is now read-only.

Conditional on VirtualScroll causes no content to be displayed in any case #147

Open
ionitron-bot bot opened this issue Nov 28, 2018 · 0 comments
Open
Labels

Comments

@ionitron-bot
Copy link

ionitron-bot bot commented Nov 28, 2018

Original issue by @AleFons on 2016-12-15T19:07:08Z

Ionic version: (check one with "x")
[ ] 1.x
[X] 2.x

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
Conditional on VirtualScroll causes no content to be displayed, even if there should be content. This is on rc4.

Expected behavior:
If there's a conditional, it should still work if the condition returns true. It used to work like this on rc2.

Related code:
html:

    <ion-list [virtualScroll]="dataStorage" [headerFn]="headerFn" *ngIf="dataStorage">
    
        <ion-item-divider *virtualHeader="let header" class="dividers">
            {{ header }}
        </ion-item-divider>
        
        <button ion-item *virtualItem="let data" (click)="openData(data.id)">
            {{ data }}
        </button>
    </ion-list>

ts:

    headerFn(record,recordIndex,records){
        if( recordIndex == 0){
            return;
        }
        return null;
    }

Other information:
If I take the same code and take out the *ngIf="dataStorage", it displays correctly.

Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):

Cordova CLI: 6.3.1
Ionic Framework Version: 2.0.0-rc.4
Ionic CLI Version: 2.1.17
Ionic App Lib Version: 2.1.7
Ionic App Scripts Version: 0.0.47
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.7.0
Xcode version: Not installed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

0 participants