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

Fix event propagation for context menus

Benjamin Bädorf07241abf8ed1
diff --git a/frontend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts b/frontend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts
index fa63240858f..117b887854f 100644
--- a/frontend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts
+++ b/frontend/src/app/shared/components/op-context-menu/handlers/op-context-menu-trigger.directive.ts
@@ -11,8 +11,10 @@ export class OpContextMenuTrigger extends OpContextMenuHandler implements AfterV
protected items:OpContextMenuItem[] = [];
- constructor(readonly elementRef:ElementRef,
- readonly opContextMenu:OPContextMenuService) {
+ constructor(
+ readonly elementRef:ElementRef,
+ readonly opContextMenu:OPContextMenuService,
+ ) {
super(opContextMenu);
}
@@ -22,16 +24,13 @@ export class OpContextMenuTrigger extends OpContextMenuHandler implements AfterV
// Open by clicking the element
this.$element.on('click', (evt:JQuery.TriggeredEvent) => {
evt.preventDefault();
- evt.stopPropagation();
// When clicking the same trigger twice, close the element instead.
if (this.opContextMenu.isActive(this)) {
this.opContextMenu.close();
- return false;
+ } else {
+ this.open(evt);
}
-
- this.open(evt);
- return false;
});
// Open with keyboard combination as well