ProgressNS / nativescript-ui-feedback

This repository is used for customer feedback regarding Telerik UI for NativeScript. The issues system here is used by customers who want to submit their feature requests or vote for existing ones.
Other
115 stars 21 forks source link

[RadListView] - iOS list view items are loaded twice. #1343

Open ejaszke opened 4 years ago

ejaszke commented 4 years ago

Tell us about the problem

We have problem with RadListView on iOS, (loaded) event is called twice on every list item. So, if we use Angular component as item template ngOnInit is also called twice.

Which platform(s) does your issue occur on?

iOS Android is fine

Please provide the following version numbers that your issue occurs with:

Please tell us how to recreate the issue in as much detail as possible.

Run simple RadListView with one item array, every item is loaded twice.

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

<RadListView [items]="[1]">
        <ng-template tkListItemTemplate let-item="item">
            <StackLayout (loaded)="loaded()">
                <Label text="test"></Label>
            </StackLayout>
        </ng-template>
</RadListView>
NickIliev commented 4 years ago

Not reproducible - test with this Playground demo.

ejaszke commented 4 years ago

@NickIliev Check this playground onLoaded function is called twice.

NickIliev commented 4 years ago

@ejaszke thanks for the provided demo - it seems that the issue is appearing only when using RadListView (and not with ListView) - try setting an empty header/footer template for your RadListView and observe if the issue will re-appear.

mapo80 commented 4 years ago

I confirm, this is bug. Same here.

How to solve?

ejaszke commented 4 years ago

We switched back to ListView :/

ejaszke commented 4 years ago

We switched back to ListView :/

Ok thanks, but I need header template!

You can use template selector to deal with it. eg. ` <ListView [items]="[ { template: 'header' }, { template: 'data', data: { ... } }, { template: 'data', data: { ... } } ]"

<ng-template [nsTemplateKey]="'header'"> <ng-template [nsTemplateKey]="'data'">

`