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: items are loaded twice (watching the itemLoading-event) #1299

Open felixkrautschuk opened 4 years ago

felixkrautschuk commented 4 years ago

Tell us about the problem

When loading some data from the server and pushing the data to the DataSouce of the RadListView, the items seem to be loaded twice on iOS.

This is the bindingContext of the page:

    items: new observableArrayModule.ObservableArray(),

    loadData: function() {
        var self = this;

        return new Promise(function (resolve, reject) {
            http.getJSON("https://restcountries.eu/rest/v2/all").then(function(response) {
                self.get('items').splice(0);
                self.get('items').push(response);

                resolve();
            }, function (e) {
                console.log(e);
                reject();
            });
        });
    }

I trigger the itemLoading event of the RadListView this way:

exports.onItemLoading = function(args) {
    console.log("itemLoadingEvent index " + args.index);
};

And this creates the following output on iOS:

CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 0 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 1 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 2 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 3 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 4 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 5 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 6 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 7 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 8 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 9 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 10 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 11 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 12 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 13 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 14 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 15 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 0 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 1 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 2 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 3 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 4 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 5 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 6 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 7 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 8 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 9 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 10 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 11 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 12 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 13 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 14 CONSOLE LOG file:///app/main-page.js:33:0: itemLoadingEvent index 15

... so you see it is loading the items twice. On Android, the output is as expected (items are loaded only once).

The same issue occurs when using pulltorefresh. You also can feel it on a physical device (e.g. iPhone 6) that the data needs more time to be actually displayed, compared to Android.

Which platform(s) does your issue occur on?

iOS

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.

  1. Start the application ..
  2. ...

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

RlvPullToRefreshIssueIOS.zip

MustafaCa commented 3 years ago

Any progress on this issue? I am also facing the same in IOS.

xb1itz commented 3 years ago

Plus on this one. Having the same problem :/