@@ -345,20 +345,25 @@ function (_React$Component) {
345345 ! ( 0 , _utilities . isset ) ( isRtl ) && ( isRtl = rtlAutodetect ? getComputedStyle ( _this . content ) . direction === "rtl" : _this . isRtl || false ) ;
346346
347347 if ( forced || _this . isRtl !== isRtl ) {
348- _this . holder . classList . toggle ( "ScrollbarsCustom-RTL" , isRtl ) ;
349-
350348 _this . isRtl = isRtl ;
349+
350+ _this . holder . classList . toggle ( "ScrollbarsCustom-RTL" , _this . isRtl ) ;
351351 }
352352
353353 if ( forced ) {
354354 var browserScrollbarWidth = ( 0 , _utilities . getScrollbarWidth ) ( ) ,
355355 fallbackScrollbarWidth = _this . props . fallbackScrollbarWidth ;
356356
357357 if ( verticalScrollNotBlocked ) {
358- _this . content . style . marginLeft = isRtl ? - ( browserScrollbarWidth || fallbackScrollbarWidth ) + "px" : null ;
359- _this . content . style . paddingLeft = isRtl ? ( browserScrollbarWidth ? null : fallbackScrollbarWidth ) + "px" : null ;
360- _this . content . style . marginRight = isRtl ? null : - ( browserScrollbarWidth || fallbackScrollbarWidth ) + "px" ;
361- _this . content . style . paddingRight = isRtl ? null : ( browserScrollbarWidth ? null : fallbackScrollbarWidth ) + "px" ;
358+ _this . content . style . marginLeft = _this . isRtl ? - ( browserScrollbarWidth || fallbackScrollbarWidth ) + "px" : null ;
359+ _this . content . style . paddingLeft = _this . isRtl ? ( browserScrollbarWidth ? null : fallbackScrollbarWidth ) + "px" : null ;
360+ _this . content . style . marginRight = _this . isRtl ? null : - ( browserScrollbarWidth || fallbackScrollbarWidth ) + "px" ;
361+ _this . content . style . paddingRight = _this . isRtl ? null : ( browserScrollbarWidth ? null : fallbackScrollbarWidth ) + "px" ;
362+
363+ if ( _this . props . defaultStyles ) {
364+ _this . trackVertical . style . left = _this . isRtl ? 0 : null ;
365+ _this . trackVertical . style . right = _this . isRtl ? null : 0 ;
366+ }
362367 } else {
363368 _this . content . style . marginLeft = _this . content . style . paddingLeft = _this . content . style . marginRight = _this . content . style . paddingRight = null ;
364369 }
@@ -429,7 +434,7 @@ function (_React$Component) {
429434 } , {
430435 key : "componentDidUpdate" ,
431436 value : function componentDidUpdate ( prevProps , prevState , snapshot ) {
432- if ( prevProps . noScroll !== this . props . noScroll || prevProps . noScrollY !== this . props . noScrollY || prevProps . noScrollX !== this . props . noScrollX || prevProps . rtl !== this . props . rtl || prevProps . permanentScrollbars !== this . props . permanentScrollbars || prevProps . permanentScrollbarX !== this . props . permanentScrollbarX || prevProps . permanentScrollbarY !== this . props . permanentScrollbarY ) {
437+ if ( prevProps . noScroll !== this . props . noScroll || prevProps . noScrollY !== this . props . noScrollY || prevProps . noScrollX !== this . props . noScrollX || prevProps . rtl !== this . props . rtl || prevProps . defaultStyles !== this . props . defaultStyles || prevProps . permanentScrollbars !== this . props . permanentScrollbars || prevProps . permanentScrollbarX !== this . props . permanentScrollbarX || prevProps . permanentScrollbarY !== this . props . permanentScrollbarY ) {
433438 this . update ( true , prevProps . rtl !== this . props . rtl ) ;
434439 }
435440
0 commit comments