Skip to content

Commit

Permalink
fix(core): ObservableArray splice ensure index is > 0 (#8921)
Browse files Browse the repository at this point in the history
Otherwise it will crash in ListView for iOS for example as it tries to animate an item with a negative row index
  • Loading branch information
farfromrefug committed Sep 30, 2020
1 parent a55bcd8 commit 6d135e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/data/observable-array/index.ts
Expand Up @@ -246,7 +246,7 @@ export class ObservableArray<T> extends Observable {
eventName: CHANGE,
object: this,
action: ChangeType.Splice,
index: Math.min(start, this._array.length-1),
index: Math.max(Math.min(start, this._array.length-1), 0),
removed: result,
addedCount: this._array.length + result.length - length,
});
Expand Down

0 comments on commit 6d135e5

Please sign in to comment.