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
[37509] Avoid position: relative on modal overlay (#9340)
Oliver Güntherdf944a83604a
diff --git a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sassindex 07d61e29f98..6db3305b449 100644--- a/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass+++ b/frontend/src/app/components/modals/preview-modal/wp-preview-modal/wp-preview.modal.sass@@ -6,3 +6,4 @@min-width: 350pxpadding: 0pxbox-shadow: 0px 0px 5px 2px rgba(0, 0, 0, 0.25)+ pointer-events: alldiff --git a/frontend/src/app/globals/global-listeners/preview-trigger.service.ts b/frontend/src/app/globals/global-listeners/preview-trigger.service.tsindex d9f0edf0f9c..40aaecb5a5a 100644--- a/frontend/src/app/globals/global-listeners/preview-trigger.service.ts+++ b/frontend/src/app/globals/global-listeners/preview-trigger.service.ts@@ -27,7 +27,7 @@//++-import { Injectable, Injector } from "@angular/core";+import { Injectable, Injector, NgZone } from "@angular/core";import { OpModalService } from "core-app/modules/modal/modal.service";import { WpPreviewModal } from "core-components/modals/preview-modal/wp-preview-modal/wp-preview.modal";@@ -35,13 +35,15 @@ import { WpPreviewModal } from "core-components/modals/preview-modal/wp-preview-export class PreviewTriggerService {private previewModal:WpPreviewModal;private modalElement:HTMLElement;+ private mouseInModal = false;constructor(readonly opModalService:OpModalService,+ readonly ngZone:NgZone,readonly injector:Injector) {}setupListener() {- jQuery(document.body).on('mouseenter', '.preview-trigger', (e) => {+ jQuery(document.body).on('mouseover', '.preview-trigger', (e) => {e.preventDefault();e.stopPropagation();const el = jQuery(e.target);@@ -61,17 +63,27 @@ export class PreviewTriggerService {this.previewModal.reposition(jQuery(this.modalElement), el);});- jQuery(document.body).on('mouseleave', '.preview-trigger', (e:JQuery.MouseLeaveEvent) => {- e.preventDefault();- e.stopPropagation();+ jQuery(document.body).on('mouseleave', '.preview-trigger', () => {+ this.closeAfterTimeout();+ });++ jQuery(document.body).on('mouseleave', '.preview-modal--container', () => {+ this.mouseInModal = false;+ this.closeAfterTimeout();+ });- if (this.isMouseOverPreview(e)) {- jQuery(this.modalElement).on('mouseleave', () => {+ jQuery(document.body).on('mouseenter', '.preview-modal--container', () => {+ this.mouseInModal = true;+ });+ }++ private closeAfterTimeout() {+ this.ngZone.runOutsideAngular(() => {+ setTimeout(() => {+ if (!this.mouseInModal) {this.opModalService.close();- });- } else {- this.opModalService.close();- }+ }+ }, 100);});}diff --git a/frontend/src/app/modules/modal/modal-overlay.sass b/frontend/src/app/modules/modal/modal-overlay.sassindex f55178f26a9..32f92dc01a9 100644--- a/frontend/src/app/modules/modal/modal-overlay.sass+++ b/frontend/src/app/modules/modal/modal-overlay.sass@@ -9,10 +9,13 @@justify-content: centeralign-items: centerdisplay: none+ pointer-events: none++ > *+ pointer-events: all&_activedisplay: flex&_not-full-screenbackground: transparent- position: relativediff --git a/frontend/src/app/modules/modal/modal.sass b/frontend/src/app/modules/modal/modal.sassindex cccb8c1adb3..15327a0960b 100644--- a/frontend/src/app/modules/modal/modal.sass+++ b/frontend/src/app/modules/modal/modal.sass@@ -7,6 +7,7 @@flex-direction: columnalign-items: stretchbackground: white+ pointer-events: allwidth: 40remmin-height: 500px