Skip to content

Commit 5fa8a5f

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

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {WrappedBoolean} from '../../data-field-template/models/wrapped-boolean';
55
import {COMMA, ENTER} from '@angular/cdk/keycodes';
66
import {MatChipInputEvent} from '@angular/material/chips';
77
import {Observable, of} from 'rxjs';
8-
import {map, startWith} from 'rxjs/operators';
8+
import {map, startWith, tap} from 'rxjs/operators';
99
import {MultichoiceAutocompleteFilterProperty} from './multichoice-autocomplete-filter-property';
1010

1111
@Component({
@@ -38,6 +38,7 @@ export abstract class AbstractMultichoiceAutocompleteFieldComponentComponent imp
3838
const value = (event['key'] || '');
3939

4040
if (value) {
41+
this.multichoiceField.value = this.multichoiceField.value === null ? [] : this.multichoiceField.value
4142
const choiceArray = [...this.multichoiceField.value];
4243
choiceArray.push(value);
4344
this.multichoiceField.value = choiceArray;

projects/netgrif-components-core/src/lib/task-content/services/task-content.service.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -342,20 +342,20 @@ export abstract class TaskContentService implements OnDestroy {
342342
private isFieldInTaskRef(changedField: string): boolean {
343343
return !!this.taskFieldsIndex &&
344344
Object.keys(this.taskFieldsIndex)
345-
.some(taskId => taskId !== this.task.stringId && this.taskFieldsIndex[taskId].fields[changedField]);
345+
.some(taskId => taskId !== this.task.stringId && this.taskFieldsIndex[taskId].fields[changedField]);
346346
}
347347

348348
private getReferencedTransitionId(changedField: string): string {
349349
if (!!this.taskFieldsIndex) {
350-
const taskFieldsIndexId = this.getReferencedFieldTask(changedField);
351-
return this.taskFieldsIndex[taskFieldsIndexId].transitionId;
350+
const taskFieldsIndexId = this.getReferencedFieldTask(changedField);
351+
return this.taskFieldsIndex[taskFieldsIndexId].transitionId;
352352
}
353353
return undefined;
354354
}
355355

356356
private getReferencedTaskId(changedField: string): string {
357357
if (!!this.taskFieldsIndex) {
358-
return Object.keys(this.taskFieldsIndex).find(taskId =>
358+
return Object.keys(this.taskFieldsIndex).find(taskId =>
359359
Object.keys(this.taskFieldsIndex[taskId].fields).includes(changedField));
360360
}
361361
return undefined;

0 commit comments

Comments
 (0)