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

focus to the global input only when the resource is a WP

Behrokh Satarnejad386ba39650f5
diff --git a/frontend/src/app/core/global_search/input/global-search-input.component.ts b/frontend/src/app/core/global_search/input/global-search-input.component.ts
index aa2e8291087..f18f6b18719 100644
--- a/frontend/src/app/core/global_search/input/global-search-input.component.ts
+++ b/frontend/src/app/core/global_search/input/global-search-input.component.ts
@@ -123,15 +123,15 @@ export class GlobalSearchInputComponent implements AfterViewInit, OnDestroy {
getOptionsFn: this.getAutocompleterData,
};
- /** Remember the current value */
- public currentValue = '';
-
- public isFocusedDirectly = (this.globalSearchService.searchTerm.length > 0);
-
/** Remember the item that best matches the query.
* That way, it will be highlighted (as we manually mark the selected item) and we can handle enter.
* */
- public selectedItem:WorkPackageResource|SearchOptionItem|undefined;
+ public selectedItem:WorkPackageResource|SearchOptionItem|undefined = undefined;
+
+ /** Remember the current value */
+ public currentValue = '';
+
+ public isFocusedDirectly = this.globalSearchService.searchTerm.length > 0 && this.selectedItem instanceof HalResource;
private unregisterGlobalListener:(() => unknown)|undefined;