File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,12 +26,14 @@ export async function initIconPicker() {
2626 modal . dataset . open = "false" ;
2727 modal . setAttribute ( "aria-hidden" , "true" ) ;
2828
29- // Only remove body scroll lock on desktop
30- if ( ! isMobile ( ) ) {
31- document . body . style . removeProperty ( 'overflow' ) ;
32- document . body . style . removeProperty ( 'position' ) ;
33- document . body . style . removeProperty ( 'top' ) ;
34- document . body . style . removeProperty ( 'width' ) ;
29+ // Always remove body scroll lock styles (in case they were applied)
30+ document . body . style . removeProperty ( 'overflow' ) ;
31+ document . body . style . removeProperty ( 'position' ) ;
32+ document . body . style . removeProperty ( 'top' ) ;
33+ document . body . style . removeProperty ( 'width' ) ;
34+
35+ // Restore scroll position on desktop
36+ if ( ! isMobile ( ) && scrollPosition > 0 ) {
3537 window . scrollTo ( 0 , scrollPosition ) ;
3638 }
3739
You can’t perform that action at this time.
0 commit comments