Commit e175b571100992f2b864538822519513c73b3926

Authored by Vladyslav
Committed by GitHub
1 parent df3614f9

[3.0] Entity list not correct find index for model (#2668)

* Entity list not correct find index for model

* Clear import

* Revert change

* Revert change
@@ -205,10 +205,11 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV @@ -205,10 +205,11 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
205 } 205 }
206 206
207 remove(entity: BaseData<EntityId>) { 207 remove(entity: BaseData<EntityId>) {
208 - const index = this.entities.indexOf(entity); 208 + let index = this.entities.indexOf(entity);
209 if (index >= 0) { 209 if (index >= 0) {
210 this.entities.splice(index, 1); 210 this.entities.splice(index, 1);
211 this.entityListFormGroup.get('entities').setValue(this.entities); 211 this.entityListFormGroup.get('entities').setValue(this.entities);
  212 + index = this.modelValue.indexOf(entity.id.id);
212 this.modelValue.splice(index, 1); 213 this.modelValue.splice(index, 1);
213 if (!this.modelValue.length) { 214 if (!this.modelValue.length) {
214 this.modelValue = null; 215 this.modelValue = null;