Skip to content

Commit 98754d8

Browse files
Copilotrenemadsen
andcommitted
Fix Angular 21 modal/dialog positioning and rendering issues
Co-authored-by: renemadsen <76994+renemadsen@users.noreply.github.com>
1 parent 677a689 commit 98754d8

2 files changed

Lines changed: 60 additions & 1 deletion

File tree

eform-client/src/app/common/helpers/dialog-config.helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ import { MatDialogConfig } from '@angular/material/dialog';
44
export function dialogConfigHelper(overlay: Overlay, data?: any): MatDialogConfig {
55
return {
66
disableClose: true,
7+
hasBackdrop: true,
78
minWidth: 300,
8-
scrollStrategy: overlay.scrollStrategies.reposition(),
9+
scrollStrategy: overlay.scrollStrategies.block(),
910
data: data,
1011
}
1112
}

eform-client/src/scss/styles.scss

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1532,3 +1532,61 @@ app-footer {
15321532
.cdk-overlay-container .ng-dropdown-panel {
15331533
z-index: 10000 !important;
15341534
}
1535+
1536+
// Fix Angular 21 dialog/modal positioning and backdrop
1537+
.cdk-global-overlay-wrapper {
1538+
display: flex !important;
1539+
position: absolute !important;
1540+
z-index: 1000 !important;
1541+
pointer-events: none !important;
1542+
top: 0 !important;
1543+
left: 0 !important;
1544+
height: 100% !important;
1545+
width: 100% !important;
1546+
justify-content: center !important;
1547+
align-items: center !important;
1548+
}
1549+
1550+
.cdk-overlay-pane {
1551+
position: relative !important;
1552+
pointer-events: auto !important;
1553+
box-sizing: border-box !important;
1554+
z-index: 1000 !important;
1555+
display: flex !important;
1556+
max-width: 100vw !important;
1557+
max-height: 100vh !important;
1558+
}
1559+
1560+
.cdk-overlay-backdrop {
1561+
position: absolute !important;
1562+
top: 0 !important;
1563+
bottom: 0 !important;
1564+
left: 0 !important;
1565+
right: 0 !important;
1566+
z-index: 1000 !important;
1567+
pointer-events: auto !important;
1568+
-webkit-tap-highlight-color: transparent !important;
1569+
transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1) !important;
1570+
opacity: 1 !important;
1571+
}
1572+
1573+
.mat-mdc-dialog-container {
1574+
display: flex !important;
1575+
flex-direction: column !important;
1576+
box-sizing: border-box !important;
1577+
overflow: auto !important;
1578+
outline: 0 !important;
1579+
width: 100% !important;
1580+
height: 100% !important;
1581+
min-height: inherit !important;
1582+
max-height: inherit !important;
1583+
pointer-events: auto !important;
1584+
}
1585+
1586+
.mat-mdc-dialog-surface {
1587+
display: flex !important;
1588+
flex-direction: column !important;
1589+
flex-grow: 1 !important;
1590+
overflow: auto !important;
1591+
max-height: 65vh !important;
1592+
}

0 commit comments

Comments
 (0)