@@ -38,6 +38,7 @@ import Scrollbar from '@ts/ui/scroll_view/scrollbar';
3838import type {
3939 AllowedDirections , DxMouseEvent , DxMouseWheelEvent , ScrollEventArgs , ScrollOffset ,
4040} from '@ts/ui/scroll_view/types' ;
41+ import { getAdjustedBaseContainerSize } from '@ts/ui/scroll_view/utils/get_adjusted_base_container_size' ;
4142
4243interface ScrollVelocity {
4344 x : number ;
@@ -562,16 +563,22 @@ export class Scroller {
562563
563564 _updateScrollbar ( ) : void {
564565 deferUpdater ( ( ) => {
565- const containerSize = this . _containerSize ( ) ;
566+ const dimension = this . _dimension ;
567+ const rawContainerSize = getBoundingRect ( this . _$container [ 0 ] ) [ dimension ] ;
568+ const containerSize = Math . round ( rawContainerSize ) ;
566569 const contentSize = this . _contentSize ( ) ;
567570
568571 // NOTE: Real container and content sizes can be a fractional number when scaling.
569572 // Let's save sizes when scale = 100% to decide whether it is necessary to show
570573 // the scrollbar based on by more precise numbers. We can do it because the container
571574 // size to content size ratio should remain approximately the same at any zoom.
572- const dimension = this . _dimension ;
573- const baseContainerSize = this . _getBaseDimension ( this . _$container [ 0 ] , dimension ) ;
575+ const rawBaseContainerSize = this . _getBaseDimension ( this . _$container [ 0 ] , dimension ) ;
574576 const baseContentSize = this . _getBaseDimension ( this . _$content [ 0 ] , dimension ) ;
577+ const baseContainerSize = getAdjustedBaseContainerSize (
578+ rawContainerSize ,
579+ rawBaseContainerSize ,
580+ baseContentSize ,
581+ ) ;
575582
576583 // eslint-disable-next-line @typescript-eslint/no-floating-promises
577584 deferRender ( ( ) => {
@@ -690,10 +697,8 @@ export class SimulatedStrategy<
690697
691698 _$content ! : dxElementWrapper ;
692699
693- // eslint-disable-next-line no-restricted-globals
694700 _updateHandlerTimeout ?: ReturnType < typeof setTimeout > ;
695701
696- // eslint-disable-next-line no-restricted-globals
697702 _validateWheelTimer ?: ReturnType < typeof setTimeout > ;
698703
699704 _eventForUserAction ?: unknown ;
0 commit comments