Don't fire remove event when Collection remains unchanged
This commit is contained in:
@@ -254,6 +254,9 @@ class Collection extends BaseObject {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
removeAt(index) {
|
removeAt(index) {
|
||||||
|
if (index < 0 || index >= this.getLength()) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
const prev = this.array_[index];
|
const prev = this.array_[index];
|
||||||
this.array_.splice(index, 1);
|
this.array_.splice(index, 1);
|
||||||
this.updateLength_();
|
this.updateLength_();
|
||||||
|
|||||||
Reference in New Issue
Block a user