From 069a650eb4fa1211d33cca2e257143c4aabf5f59 Mon Sep 17 00:00:00 2001 From: Alex Inkin Date: Thu, 15 Feb 2024 18:42:10 +0400 Subject: [PATCH] chore: small changes (#6800) --- projects/core/components/scrollbar/scrollbar.component.ts | 7 ++++--- projects/core/components/scrollbar/scrollbar.style.less | 4 ++++ projects/core/components/scrollbar/scrollbar.template.html | 5 ++++- .../badge-notification/badge-notification.style.less | 6 ++++++ projects/i18n/languages/english/kit.ts | 2 +- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/projects/core/components/scrollbar/scrollbar.component.ts b/projects/core/components/scrollbar/scrollbar.component.ts index 1dd8bedc74c6..d7f46cc22f6d 100644 --- a/projects/core/components/scrollbar/scrollbar.component.ts +++ b/projects/core/components/scrollbar/scrollbar.component.ts @@ -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) && @@ -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); } @@ -65,7 +67,6 @@ export class TuiScrollbarComponent { @HostListener(`${TUI_SCROLLABLE}.stop`, ['$event.detail']) onScrollable(element: HTMLElement): void { - this.delegated = true; this.browserScrollRef.nativeElement = element; } diff --git a/projects/core/components/scrollbar/scrollbar.style.less b/projects/core/components/scrollbar/scrollbar.style.less index 680e9239bcf1..4eadd048a1d7 100644 --- a/projects/core/components/scrollbar/scrollbar.style.less +++ b/projects/core/components/scrollbar/scrollbar.style.less @@ -32,6 +32,10 @@ flex-basis: auto; width: 100%; height: max-content; + + &_delegated { + height: 100%; + } } .t-bars { diff --git a/projects/core/components/scrollbar/scrollbar.template.html b/projects/core/components/scrollbar/scrollbar.template.html index fe01c7e4c943..9f276ad5f6e0 100644 --- a/projects/core/components/scrollbar/scrollbar.template.html +++ b/projects/core/components/scrollbar/scrollbar.template.html @@ -2,6 +2,9 @@ *ngIf="showScrollbars" class="t-bars" > -
+
diff --git a/projects/experimental/components/badge-notification/badge-notification.style.less b/projects/experimental/components/badge-notification/badge-notification.style.less index db8c85f1a79c..46754504a1d2 100644 --- a/projects/experimental/components/badge-notification/badge-notification.style.less +++ b/projects/experimental/components/badge-notification/badge-notification.style.less @@ -34,4 +34,10 @@ padding: 0; font-size: 0; } + + :host-context([tuiIconButton]) { + position: absolute; + right: 25%; + top: 25%; + } } diff --git a/projects/i18n/languages/english/kit.ts b/projects/i18n/languages/english/kit.ts index 7b14936dffe6..d62970d8ebb0 100644 --- a/projects/i18n/languages/english/kit.ts +++ b/projects/i18n/languages/english/kit.ts @@ -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',