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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Prevent focussing on dropdwon trigger after click
Oliver Günther54a6038d8398
diff --git a/frontend/src/app/shared/components/modal/modal-overlay.component.html b/frontend/src/app/shared/components/modal/modal-overlay.component.htmlindex 3d9411c16dd..c3fc04dbd20 100644--- a/frontend/src/app/shared/components/modal/modal-overlay.component.html+++ b/frontend/src/app/shared/components/modal/modal-overlay.component.html@@ -6,6 +6,7 @@tabindex="0"cdkFocusInitialcdkTrapFocus+ [cdkTrapFocusAutoCapture]="true"(mousedown)="close($event, false)"><buttondiff --git a/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts b/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.tsindex 6286dd8c242..dbb55856d4d 100644--- a/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts+++ b/frontend/src/app/shared/components/op-context-menu/handlers/op-settings-dropdown-menu.directive.ts@@ -61,8 +61,6 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger {private loadingPromise:PromiseLike<any>;- private focusAfterClose = true;-constructor(readonly elementRef:ElementRef,readonly opContextMenu:OPContextMenuService,readonly opModalService:OpModalService,@@ -128,8 +126,8 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger {return position;}- public onClose() {- if (this.focusAfterClose) {+ public onClose(focus:boolean) {+ if (focus) {this.afterFocusOn.focus();}}@@ -224,7 +222,6 @@ export class OpSettingsMenuDirective extends OpContextMenuTrigger {icon: 'icon-edit',onClick: ($event:JQuery.TriggeredEvent) => {if (this.allowQueryAction($event, 'update')) {- this.focusAfterClose = false;jQuery(`${selectableTitleIdentifier}`).trigger(triggerEditingEvent);}diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu-handler.ts b/frontend/src/app/shared/components/op-context-menu/op-context-menu-handler.tsindex e58fce1697d..4e5dcc15139 100644--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu-handler.ts+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu-handler.ts@@ -17,9 +17,13 @@ export abstract class OpContextMenuHandler extends UntilDestroyedMixin {/*** Called when the service closes this context menu+ *+ * @param focus Focus on the trigger again*/- public onClose() {- this.afterFocusOn.trigger('focus');+ public onClose(focus = false) {+ if (focus) {+ this.afterFocusOn.trigger('focus');+ }}public onOpen(menu:JQuery) {diff --git a/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts b/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.tsindex be2ddbcb01b..b13944a0f9b 100644--- a/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts+++ b/frontend/src/app/shared/components/op-context-menu/op-context-menu.service.ts@@ -55,7 +55,7 @@ export class OPContextMenuService {// Listen to keyups on window to close context menusjQuery(window).on('keydown', (evt:JQuery.TriggeredEvent) => {if (this.active && evt.which === KeyCodes.ESCAPE) {- this.close();+ this.close(true);}return true;@@ -102,7 +102,7 @@ export class OPContextMenuService {/*** Closes all currently open context menus.*/- public close():void {+ public close(focus = false):void {if (this.isOpening) {return;}@@ -110,7 +110,7 @@ export class OPContextMenuService {// Detach any component currently in the portalthis.bodyPortalHost.detach();this.portalHostElement.style.display = 'none';- this.active?.onClose();+ this.active?.onClose(focus);this.active = null;}