We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 28a2aa8 commit 55909e8Copy full SHA for 55909e8
1 file changed
packages/focus/src/index.js
@@ -199,8 +199,16 @@ function disableScrolling() {
199
let paddingRight = document.documentElement.style.paddingRight
200
201
let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth
202
+ let scrollbarGutter = window.getComputedStyle(document.documentElement).scrollbarGutter
203
204
document.documentElement.style.overflow = 'hidden'
205
+
206
+ if (scrollbarGutter && scrollbarGutter !== 'auto') {
207
+ return () => {
208
+ document.documentElement.style.overflow = overflow
209
+ }
210
211
212
document.documentElement.style.paddingRight = `${scrollbarWidth}px`
213
214
return () => {
0 commit comments