Skip to content

Commit

Permalink
feat(cdk): scroll controls should be visible only inside tui-root area (
Browse files Browse the repository at this point in the history
  • Loading branch information
splincode authored Jan 31, 2024
1 parent 1237ede commit ad35cdb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export class TuiDialogHostComponent<T extends TuiDialog<unknown, unknown>>
this.dialogs = dialogs;
this.cdr.markForCheck();

this.doc.documentElement.classList.toggle(
this.doc.defaultView?.document.documentElement.classList.toggle(
't-overscroll-none',
!!dialogs.length,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
top: 0;
left: 0;
z-index: 1;
display: none;
min-width: calc(100% - 1px);
min-height: calc(100% - 1px);
max-width: calc(100% - 1px);
max-height: calc(100% - 1px);
float: left;
margin-inline-end: calc(-100% + 1px);
pointer-events: none;

&:host-context([data-tui-theme]) {
display: block;
}
}

.t-bar {
Expand Down
7 changes: 5 additions & 2 deletions projects/core/components/root/root.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,12 @@ export class TuiRootComponent {
@Inject(TuiBreakpointService) private readonly breakpoint: TuiBreakpointService,
@Inject(TUI_IS_IOS) readonly isIOS: boolean,
@Inject(TUI_IS_ANDROID) readonly isAndroid: boolean,
@Inject(DOCUMENT) {body}: Document,
@Inject(DOCUMENT) document: Document,
@Inject(TUI_THEME) theme: string,
) {
body.setAttribute('data-tui-theme', theme.toLowerCase());
document.defaultView?.document.body.setAttribute(
'data-tui-theme',
theme.toLowerCase(),
);
}
}

0 comments on commit ad35cdb

Please sign in to comment.