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 floating modal position

Christophe Bliard4933b449f517
diff --git a/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts
index 03a39dcacfc..e126e548ef4 100644
--- a/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts
+++ b/frontend/src/app/shared/components/fields/display/info/op-exclusion-info.component.ts
@@ -30,6 +30,7 @@
import {
ChangeDetectionStrategy,
+ ChangeDetectorRef,
Component,
} from '@angular/core';
import { I18nService } from 'core-app/core/i18n/i18n.service';
@@ -45,10 +46,12 @@ export class OpExclusionInfoComponent {
constructor(
readonly I18n:I18nService,
+ readonly cdRef:ChangeDetectorRef,
) {}
public toggleOpen(event:Event):void {
event.stopPropagation();
this.opened = !this.opened;
+ this.cdRef.detectChanges();
}
}
diff --git a/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts b/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts
index 44915c491f3..ffeb9b9167b 100644
--- a/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts
+++ b/frontend/src/app/spot/components/drop-modal/drop-modal.component.ts
@@ -207,7 +207,10 @@ export class SpotDropModalComponent implements OnDestroy {
private onGlobalClick = this.close.bind(this) as () => void;
ngOnDestroy():void {
- this.teleportationService.clear();
+ if (this.opened) {
+ this.teleportationService.clear();
+ }
+
document.body.removeEventListener('click', this.onGlobalClick);
document.body.removeEventListener('keydown', this.onEscape);
window.removeEventListener('resize', this.onResize);