Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Run a change detection cycle after setting results$, so the model is updated

Oliver Güntherb01396714b7a
diff --git a/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts b/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
index 50cac82ce07..0d15f10a7a9 100644
--- a/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
+++ b/frontend/src/app/shared/components/autocompleter/op-autocompleter/op-autocompleter.component.ts
@@ -343,25 +343,25 @@ export class OpAutocompleterComponent<T extends IAutocompleteItem = IAutocomplet
});
}
- this.ngZone.runOutsideAngular(() => {
- setTimeout(() => {
- this.results$ = merge(
- this.items$,
- this.autocompleteInputStream(),
- );
+ setTimeout(() => {
+ this.results$ = merge(
+ this.items$,
+ this.autocompleteInputStream(),
+ );
+
+ if (this.fetchDataDirectly) {
+ this.typeahead?.next('');
+ }
- if (this.fetchDataDirectly) {
- this.typeahead?.next('');
- }
+ if (this.openDirectly) {
+ this.ngSelectInstance.open();
+ this.ngSelectInstance.focus();
+ } else if (this.focusDirectly) {
+ this.ngSelectInstance.focus();
+ }
- if (this.openDirectly) {
- this.ngSelectInstance.open();
- this.ngSelectInstance.focus();
- } else if (this.focusDirectly) {
- this.ngSelectInstance.focus();
- }
- }, 25);
- });
+ this.cdRef.detectChanges();
+ }, 25);
}
public get mappedInputValue():string|string[] {