From 084ea5dd57104ea04bdb0c60c6e165a7ccbebe1f Mon Sep 17 00:00:00 2001 From: splincode Date: Wed, 14 Feb 2024 15:45:41 +0300 Subject: [PATCH] fix(core): take into account scrollbar in active zone --- .../components/scroll-controls/scrollbar.directive.ts | 8 +------- .../tests/core/dropdown/dropdown.spec.ts | 11 +++++++++++ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/projects/cdk/components/scroll-controls/scrollbar.directive.ts b/projects/cdk/components/scroll-controls/scrollbar.directive.ts index bd168f78a5d4..df46d94a43fc 100644 --- a/projects/cdk/components/scroll-controls/scrollbar.directive.ts +++ b/projects/cdk/components/scroll-controls/scrollbar.directive.ts @@ -2,12 +2,7 @@ import {DOCUMENT} from '@angular/common'; import {Directive, ElementRef, Inject, Input, NgZone, Self} from '@angular/core'; import {ANIMATION_FRAME} from '@ng-web-apis/common'; import {POLLING_TIME} from '@taiga-ui/cdk/constants'; -import { - tuiScrollFrom, - tuiStopPropagation, - tuiTypedFromEvent, - tuiZonefree, -} from '@taiga-ui/cdk/observables'; +import {tuiScrollFrom, tuiTypedFromEvent, tuiZonefree} from '@taiga-ui/cdk/observables'; import {TuiDestroyService} from '@taiga-ui/cdk/services'; import {TUI_SCROLL_REF} from '@taiga-ui/cdk/tokens'; import {merge, Observable} from 'rxjs'; @@ -48,7 +43,6 @@ export class TuiScrollbarDirective { merge( mousedownWrapper$.pipe(map(event => this.getScrolled(event, 0.5, 0.5))), mousedown$.pipe( - tuiStopPropagation(), switchMap(event => { const rect = nativeElement.getBoundingClientRect(); const vertical = getOffsetVertical(event, rect); diff --git a/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts b/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts index f57f5e59bcc6..190d895e2242 100644 --- a/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts +++ b/projects/demo-playwright/tests/core/dropdown/dropdown.spec.ts @@ -68,4 +68,15 @@ test.describe('Dropdown', () => { await page.keyboard.press('Escape'); await expect(page).toHaveScreenshot('09-dropdown.png'); }); + + test('Scrollbar dropdown in active zone', async ({page}) => { + await tuiGoto(page, '/directives/dropdown/API?tuiDropdownMaxHeight=150'); + + const api = new TuiDocumentationPagePO(page).apiPageExample; + + await api.locator('button').click(); + await expect(page).toHaveScreenshot('10-dropdown.png'); + await page.locator('tui-dropdown').locator('tui-scrollbar .t-thumb').click(); + await expect(page).toHaveScreenshot('11-dropdown.png'); + }); });