From b87737ae2d98a266fa37e367caac003ab45e9a76 Mon Sep 17 00:00:00 2001 From: Alex Inkin Date: Wed, 20 Jan 2021 23:14:29 +0300 Subject: [PATCH] fix(kit): `TabsWithMore` fix freezing on resize loop (#121) Co-authored-by: Roman Sedov --- .../components/table-bars-host/table-bars-host.style.less | 2 +- .../components/tabs/tabs-with-more/tabs-with-more.providers.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/addon-tablebars/components/table-bars-host/table-bars-host.style.less b/projects/addon-tablebars/components/table-bars-host/table-bars-host.style.less index 19c884543c39..dcf6c119a21d 100644 --- a/projects/addon-tablebars/components/table-bars-host/table-bars-host.style.less +++ b/projects/addon-tablebars/components/table-bars-host/table-bars-host.style.less @@ -18,7 +18,7 @@ .bar { .shadow(); flex: 0 0 100%; - background: var(--tui-base-06); + background: var(--tui-base-07); color: var(--tui-base-01); &_light { diff --git a/projects/kit/components/tabs/tabs-with-more/tabs-with-more.providers.ts b/projects/kit/components/tabs/tabs-with-more/tabs-with-more.providers.ts index 2514545c9008..0a3e7c4a6f9f 100644 --- a/projects/kit/components/tabs/tabs-with-more/tabs-with-more.providers.ts +++ b/projects/kit/components/tabs/tabs-with-more/tabs-with-more.providers.ts @@ -6,7 +6,7 @@ import { } from '@ng-web-apis/mutation-observer'; import {TuiDestroyService, TuiResizeService} from '@taiga-ui/cdk'; import {merge, Observable} from 'rxjs'; -import {filter, startWith, takeUntil, tap} from 'rxjs/operators'; +import {debounceTime, filter, startWith, takeUntil, tap} from 'rxjs/operators'; export function tabsRefreshFactory( resize$: Observable, @@ -22,6 +22,7 @@ export function tabsRefreshFactory( ).pipe( // Ignoring cases when host is detached from DOM filter(() => body.contains(nativeElement)), + debounceTime(0), startWith(null), takeUntil(destroy$), );