fix(core): ObservableArray splice ensure index is > 0 (#8921)

Otherwise it will crash in ListView for iOS for example as it tries to animate an item with a negative row index
This commit is contained in:
Martin Guillon
2020-10-01 01:54:54 +02:00
committed by GitHub
parent a55bcd8561
commit 6d135e5d63

View File

@ -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,
});