diff --git a/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts index 2de300afd5..67ea126b30 100644 --- a/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts +++ b/frontend/src/app/modules/fields/edit/field-types/te-work-package-edit-field.component.ts @@ -54,6 +54,7 @@ export class TimeEntryWorkPackageEditFieldComponent extends WorkPackageEditField // existing values. if (this.referenceOutputs) { this.referenceOutputs['modeSwitch'] = (mode:TimeEntryWorkPackageAutocompleterMode) => { + this.valuesLoaded = false; let lastValue = this.requests.lastRequestedValue!; // Hack to provide a new value to "reset" the input. diff --git a/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.html b/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.html index a21fbe18be..0e23f83553 100644 --- a/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.html +++ b/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.html @@ -4,7 +4,7 @@ model: selectedOption ? selectedOption : '', required: required, disabled: inFlight, - typeahead: requests.input$, + typeahead: typeahead, id: handler.htmlId, finishedLoading: requests.loading$, hideSelected: true, diff --git a/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.ts b/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.ts index d895bd2057..5bced89019 100644 --- a/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.ts +++ b/frontend/src/app/modules/fields/edit/field-types/work-package-edit-field.component.ts @@ -57,6 +57,14 @@ export class WorkPackageEditFieldComponent extends SelectEditFieldComponent { }); } + public get typeahead() { + if (this.valuesLoaded) { + return false; + } else { + return this.requests.input$; + } + } + protected allowedValuesFilter(query?:string):{} { let filterParams = super.allowedValuesFilter(query);