From 20232547ffe1dacb9ea9ad04d727d1a5ddd344a0 Mon Sep 17 00:00:00 2001 From: Aleksey Novikov Date: Fri, 20 Dec 2024 18:29:46 +0300 Subject: [PATCH] #6288 Smooth scroll incorrectly works with new scrollbar (#6289) Fixes #6288 --- packages/survey-creator-core/src/components/scroll.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/survey-creator-core/src/components/scroll.ts b/packages/survey-creator-core/src/components/scroll.ts index a3af245ad6..20b603352a 100644 --- a/packages/survey-creator-core/src/components/scroll.ts +++ b/packages/survey-creator-core/src/components/scroll.ts @@ -17,6 +17,8 @@ export class ScrollViewModel { private _scrollbarSizerElement: HTMLElement; private _containerBodyResizeObserver: ResizeObserver; + private _lockScroll = false; + constructor() { //this.dragTypeOverMe = this.row.dragTypeOverMe; } @@ -40,10 +42,15 @@ export class ScrollViewModel { } public onScrollContainer() { + this._lockScroll = true; this._scrollbarElement.scrollTop = this._containerElementValue.scrollTop; } public onScrollScrollbar() { + if (this._lockScroll) { + this._lockScroll = false; + return; + } this._containerElementValue.scrollTop = this._scrollbarElement.scrollTop; }