File tree Expand file tree Collapse file tree 4 files changed +14
-6
lines changed
Expand file tree Collapse file tree 4 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010### Fixed
1111
1212- Icon: Add missing class to style svg correctly
13+ - Dialog/Lightbox: Fix unexpected scroll to top when opening a dialog or lightbox.
1314
1415## [ 1.0.19] [ ] - 2021-07-15
1516
Original file line number Diff line number Diff line change 1010 "@lumx/core" : " ^1.0.19" ,
1111 "@lumx/icons" : " ^1.0.19" ,
1212 "@popperjs/core" : " ^2.5.4" ,
13- "body-scroll-lock" : " ^2.6.4 " ,
13+ "body-scroll-lock" : " ^3.1.5 " ,
1414 "classnames" : " ^2.2.6" ,
1515 "react-is" : " ^16.13.0" ,
1616 "react-popper" : " ^2.2.4" ,
Original file line number Diff line number Diff line change @@ -7,7 +7,14 @@ export const useDisableBodyScroll = (modalElement: Element | Falsy): void => {
77 if ( ! modalElement ) {
88 return undefined ;
99 }
10+ // Fixing the document overflow style to prevent a bug that scrolls the window to the top.
11+ const previousDocumentOverflow = document . documentElement . style . overflow ;
12+ document . documentElement . style . overflow = 'visible' ;
1013 disableBodyScroll ( modalElement ) ;
11- return ( ) => enableBodyScroll ( modalElement ) ;
14+ return ( ) => {
15+ enableBodyScroll ( modalElement ) ;
16+ // Restore the previous overflow style.
17+ document . documentElement . style . overflow = previousDocumentOverflow ;
18+ } ;
1219 } , [ modalElement ] ) ;
1320} ;
Original file line number Diff line number Diff line change 80618061 raw-body "2.4.0"
80628062 type-is "~1.6.17"
80638063
8064- body-scroll-lock@^2.6.4 :
8065- version "2.6.4 "
8066- resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-2.6.4 .tgz#567abc60ef4d656a79156781771398ef40462e94 "
8067- integrity sha512-NP08WsovlmxEoZP9pdlqrE+AhNaivlTrz9a0FF37BQsnOrpN48eNqivKkE7SYpM9N+YIPjsdVzfLAUQDBm6OQw ==
8064+ body-scroll-lock@^3.1.5 :
8065+ version "3.1.5 "
8066+ resolved "https://registry.yarnpkg.com/body-scroll-lock/-/body-scroll-lock-3.1.5 .tgz#c1392d9217ed2c3e237fee1e910f6cdd80b7aaec "
8067+ integrity sha512-Yi1Xaml0EvNA0OYWxXiYNqY24AfWkbA6w5vxE7GWxtKfzIbZM+Qw+aSmkgsbWzbHiy/RCSkUZBplVxTA+E4jJg ==
80688068
80698069bonjour@^3.5.0:
80708070 version "3.5.0"
You can’t perform that action at this time.
0 commit comments