Commit e175b571100992f2b864538822519513c73b3926
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
Showing
1 changed file
with
2 additions
and
1 deletions
... | ... | @@ -205,10 +205,11 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV |
205 | 205 | } |
206 | 206 | |
207 | 207 | remove(entity: BaseData<EntityId>) { |
208 | - const index = this.entities.indexOf(entity); | |
208 | + let index = this.entities.indexOf(entity); | |
209 | 209 | if (index >= 0) { |
210 | 210 | this.entities.splice(index, 1); |
211 | 211 | this.entityListFormGroup.get('entities').setValue(this.entities); |
212 | + index = this.modelValue.indexOf(entity.id.id); | |
212 | 213 | this.modelValue.splice(index, 1); |
213 | 214 | if (!this.modelValue.length) { |
214 | 215 | this.modelValue = null; | ... | ... |