Skip to content

Commit 3d732dc

Browse files
committed
[NAE-1766] Options on multichoice autocomplete do not refresh in a specific situation
- fix
1 parent 5fa8a5f commit 3d732dc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

projects/netgrif-components-core/src/lib/data-fields/multichoice-field/multichoice-autocomplete-field/abstract-multichoice-autocomplete-field-component.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ export abstract class AbstractMultichoiceAutocompleteFieldComponentComponent imp
2424
filteredOptions: Observable<Array<MultichoiceFieldValue>>;
2525

2626
ngOnInit() {
27-
this.filteredOptions = this.formControlRef.valueChanges.pipe(
28-
startWith(''),
29-
map(value => this._filter(value).filter((option) => !this.multichoiceField.value.includes(option.key)))
30-
);
27+
this.formControlRef.valueChanges.subscribe(newVal => {
28+
startWith('')
29+
this.filteredOptions = of(this._filter(newVal ?? '').filter((option) => !this.multichoiceField.value?.includes(option.key)));
30+
})
3131
}
3232

3333
ngOnDestroy(): void {

0 commit comments

Comments
 (0)