FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

listview android bug and fix · Issue #1371 · NativeScript/NativeScript · GitHub

listview android bug and fix #1371

Description

Background :

  • Load item 50, "realizedItems" is 6, this is the item cached to display at the screen
  • Filter the array to 5, scroll up, it will crash because realizedItems>new array

Solution : (list-view.android.js)

    ListView.prototype._notifyScrollIdle = function () {
        var keys = Object.keys(this._realizedItems);
        var i;
        var length = keys.length;
        var view;
        var key;
        for (i = 0; i < length; i++) {
            key = keys[i];
            view = this._realizedItems[key];
            if (view[REALIZED_INDEX]<this.items.length) // FIX
            this.notify({
                eventName: ITEMLOADING,
                object: this,
                index: view[REALIZED_INDEX],
                view: view
            });
        }
    };

IOS is working fine

(EDITED because the first fix is still getting error @Lollipop)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL