File tree Expand file tree Collapse file tree 3 files changed +2
-10
lines changed
Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,8 @@ class ScrollControl {
2727 const clientOffset = this . element . tagName === 'BODY' ? window . innerWidth : this . element . offsetWidth ;
2828 // Browser scrollbar width, may be 0 on some devices, but solves offset when is not 0.
2929 const scrollBarWidth = clientOffset - this . element . clientWidth ;
30- // Save Y offset for later purpose
31- this . offsetY = window . scrollY ;
3230 // Fixing page offset causing scrollbar on some devices
3331 this . element . style . paddingRight = `${ scrollBarWidth } px` ;
34- // Fixing position
35- this . element . style . top = `-${ this . offsetY } px` ;
3632 // Add body class
3733 this . element . classList . add ( SCROLLING_DISABLED_CLASSNAME ) ;
3834 }
@@ -44,11 +40,8 @@ class ScrollControl {
4440 executeAfterTransition ( this . target , ( ) => {
4541 // Reset style values
4642 this . element . style . paddingRight = '' ;
47- this . element . style . top = '' ;
4843 // Remove body class
4944 this . element . classList . remove ( SCROLLING_DISABLED_CLASSNAME ) ;
50- // Scroll after close to saved Y offset position
51- window . scrollTo ( 0 , this . offsetY ) ;
5245 } ) ;
5346 }
5447 }
Original file line number Diff line number Diff line change 2222 visibility : hidden ; // 1.
2323 opacity : 0 ; // 1.
2424 pointer-events : none ; // 1.
25+ overscroll-behavior : contain ;
2526
2627 // 2.
2728 & ::backdrop {
Original file line number Diff line number Diff line change 11.is-scrolling-disabled {
2- position : fixed ;
3- width : 100% ;
4- overflow-y : hidden ;
2+ overflow : hidden ;
53}
You can’t perform that action at this time.
0 commit comments