Skip to content

listview android bug and fix #1371

@x4080

Description

@x4080

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)

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