Skip to content

Commit

Permalink
refactor(kit): add tuiZonefreeScheduler for TuiCarouselScroll (#8743
Browse files Browse the repository at this point in the history
)
  • Loading branch information
splincode authored Sep 5, 2024
1 parent 31608b6 commit abcaf12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions projects/kit/components/carousel/carousel-scroll.directive.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {Directive, Output} from '@angular/core';
import {tuiTypedFromEvent} from '@taiga-ui/cdk/observables';
import {tuiTypedFromEvent, tuiZonefreeScheduler} from '@taiga-ui/cdk/observables';
import {tuiInjectElement} from '@taiga-ui/cdk/utils/dom';
import {filter, map, tap, throttleTime} from 'rxjs';

Expand All @@ -13,7 +13,7 @@ export class TuiCarouselScroll {
@Output()
public readonly tuiCarouselScroll = tuiTypedFromEvent(this.el, 'wheel').pipe(
filter(({deltaX}) => Math.abs(deltaX) > 20),
throttleTime(500),
throttleTime(500, tuiZonefreeScheduler()),
map(({deltaX}) => Math.sign(deltaX)),
tap(() => {
// So we always have space to scroll and overflow-behavior saves us from back nav
Expand Down

0 comments on commit abcaf12

Please sign in to comment.