Skip to content

Commit

Permalink
refactor(cdk): add tuiZonefreeScheduler for `TuiDocScrollIntoViewLi…
Browse files Browse the repository at this point in the history
…nk` (#8745)
  • Loading branch information
splincode authored Sep 4, 2024
1 parent bb19998 commit f7f371e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {Directive, inject, Input} from '@angular/core';
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
import {TUI_DOC_PAGE_LOADED} from '@taiga-ui/addon-doc/tokens';
import {tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';
import {tuiGetElementObscures, tuiInjectElement} from '@taiga-ui/cdk/utils/dom';
import {debounceTime, filter, ReplaySubject, switchMap} from 'rxjs';

Expand All @@ -16,7 +17,7 @@ export class TuiDocScrollIntoViewLink {
.pipe(
filter(Boolean),
switchMap(() => this.scroll$),
debounceTime(750),
debounceTime(750, tuiZonefreeScheduler()),
filter((shallWe) => shallWe && !!tuiGetElementObscures(this.el)),
takeUntilDestroyed(),
)
Expand Down

0 comments on commit f7f371e

Please sign in to comment.