Skip to content

Commit

Permalink
fix(addon-mobile): PullToRefresh do not trigger pulled if dialog is…
Browse files Browse the repository at this point in the history
… inside (#8580)
  • Loading branch information
vladimirpotekhin authored Aug 19, 2024
1 parent b98902b commit 5f003ac
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
} from './pull-to-refresh.providers';

export const MICRO_OFFSET = 10 ** -6;
const EXCLUSION_SELECTORS = 'tui-dialog, tui-dropdown, tui-dropdown-mobile';

@Injectable()
export class TuiPullToRefreshService extends Observable<number> {
Expand All @@ -33,7 +34,11 @@ export class TuiPullToRefreshService extends Observable<number> {
startWith(null),
switchMap(() =>
tuiTypedFromEvent(this.element, 'touchstart', {passive: true}).pipe(
filter(() => !this.scrollTop),
filter(
() =>
!this.scrollTop &&
!this.el.nativeElement.querySelector(EXCLUSION_SELECTORS),
),
map(({touches}) => touches[0].clientY),
switchMap(start =>
tuiTypedFromEvent(this.element, 'touchmove').pipe(
Expand Down

0 comments on commit 5f003ac

Please sign in to comment.