From 57dd4a89e6ffefbe1a26f94a11fdd80c71b565d0 Mon Sep 17 00:00:00 2001 From: Henriette Darge Date: Thu, 5 May 2022 09:53:00 +0200 Subject: [PATCH] Stop event propagation on mobile to avoid a quick open and direct close of the search. That is fine, as on mobile no other modal could wait for this event as the modals span full height. --- .../core/global_search/input/global-search-input.component.ts | 3 +++ 1 file changed, 3 insertions(+) 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 b9949d466b..3eea0c6ab2 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 @@ -172,6 +172,9 @@ export class GlobalSearchInputComponent implements AfterViewInit, OnDestroy { this.toggleMobileSearch(); // open ng-select menu on default jQuery('.ng-input input').focus(); + // only for mobile and not for all devices! + // See https://github.com/opf/openproject/commit/a2eb0cd6025f2ecaca00f4ed81c4eb8e9399bd86 + event.stopPropagation(); } else if (this.searchTerm?.length === 0) { this.ngSelectComponent.ngSelectInstance.focus(); } else {