Skip to content

Commit c3a710f

Browse files
committed
feat: overflow functionality
1 parent b93df6c commit c3a710f

File tree

5 files changed

+13
-2
lines changed

5 files changed

+13
-2
lines changed

apps/playground/src/app/app.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ <h2>Configure your dialog</h2>
5757
<label>Close Button</label>
5858
<input type="checkbox" formControlName="closeButton" />
5959
</div>
60+
<div>
61+
<label>Overflow ❌</label>
62+
<input type="checkbox" formControlName="overflow" />
63+
</div>
6064
<ng-container formGroupName="enableClose">
6165
<div>
6266
<label>Escape to Close ❌</label>

apps/playground/src/app/app.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ button {
2424
}
2525

2626
form {
27-
max-height: 260px;
27+
max-height: 300px;
2828
display: flex;
2929
flex-direction: column;
3030
flex-wrap: wrap;

apps/playground/src/app/app.component.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export class AppComponent {
3737
backdrop: [true],
3838
resizable: [false],
3939
draggable: [false],
40+
overflow: [true],
4041
dragConstraint: ['none'],
4142
size: [''],
4243
windowClass: [''],
@@ -76,6 +77,9 @@ export class AppComponent {
7677
this.backDropClicked = false;
7778
this.cleanConfig = this.normalizeConfig(config);
7879

80+
if (this.cleanConfig.overflow) document.body.classList.add('overflow');
81+
else document.body.classList.remove('overflow');
82+
7983
const ref = this.dialog.open(compOrTemplate as any, this.cleanConfig);
8084

8185
ref?.backdropClick$.subscribe({

libs/dialog/src/lib/dialog.component.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
flex-direction: column;
44
overflow: hidden;
55
position: relative;
6+
67
@keyframes dialog-open {
78
0% {
89
transform: translateX(50px);
910
}
11+
1012
100% {
1113
transform: none;
1214
}
@@ -97,6 +99,6 @@
9799
}
98100
}
99101

100-
body.ngneat-dialog-hidden {
102+
body.ngneat-dialog-hidden:not(.overflow) {
101103
overflow: hidden;
102104
}

libs/dialog/src/lib/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface GlobalDialogConfig {
3232
backdrop: CloseStrategy;
3333
};
3434
resizable: boolean;
35+
overflow: boolean;
3536
width: string | number;
3637
minWidth: string | number;
3738
maxWidth: string | number;

0 commit comments

Comments
 (0)