Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: small changes #6800

Merged
merged 1 commit into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions projects/core/components/scrollbar/scrollbar.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import {TUI_SCROLL_INTO_VIEW, TUI_SCROLLABLE} from '@taiga-ui/core/constants';
],
})
export class TuiScrollbarComponent {
private delegated = false;

private readonly isLegacy: boolean =
!this.cssRef.supports('position', 'sticky') ||
(tuiIsFirefox(this.userAgent) &&
Expand All @@ -54,6 +52,10 @@ export class TuiScrollbarComponent {
@Inject(TUI_IS_IOS) private readonly isIos: boolean,
) {}

get delegated(): boolean {
return this.browserScrollRef.nativeElement !== this.el.nativeElement;
}

get showScrollbars(): boolean {
return !this.hidden && !this.isIos && (!this.isLegacy || this.delegated);
}
Expand All @@ -65,7 +67,6 @@ export class TuiScrollbarComponent {

@HostListener(`${TUI_SCROLLABLE}.stop`, ['$event.detail'])
onScrollable(element: HTMLElement): void {
this.delegated = true;
this.browserScrollRef.nativeElement = element;
}

Expand Down
4 changes: 4 additions & 0 deletions projects/core/components/scrollbar/scrollbar.style.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
flex-basis: auto;
width: 100%;
height: max-content;

&_delegated {
height: 100%;
}
}

.t-bars {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
*ngIf="showScrollbars"
class="t-bars"
></tui-scroll-controls>
<div class="t-content">
<div
class="t-content"
[class.t-content_delegated]="delegated"
>
<ng-content></ng-content>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,10 @@
padding: 0;
font-size: 0;
}

:host-context([tuiIconButton]) {
position: absolute;
right: 25%;
top: 25%;
}
}
2 changes: 1 addition & 1 deletion projects/i18n/languages/english/kit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const TUI_ENGLISH_LANGUAGE_KIT: TuiLanguageKit = {
defaultLabelMultiple: 'or drop\u00A0them\u00A0here',
defaultLinkSingle: 'Choose a file',
defaultLinkMultiple: 'Choose files',
maxSizeRejectionReason: 'File is too large ',
maxSizeRejectionReason: 'File is larger than ',
formatRejectionReason: 'Wrong file type',
drop: 'Drop file here',
dropMultiple: 'Drop files here',
Expand Down
Loading