mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 02:54:11 +08:00
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:
@ -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,
|
||||
});
|
||||
|
Reference in New Issue
Block a user