Skip to content

Commit aba3bc9

Browse files
authored
[material-ui][Drawer] Fix issue with main window being used instead of iframe's window (#43818)
1 parent ca7ffd6 commit aba3bc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/mui-utils/src/getScrollbarSize/getScrollbarSize.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
export default function getScrollbarSize(doc: Document): number {
44
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
55
const documentWidth = doc.documentElement.clientWidth;
6-
return Math.abs(window.innerWidth - documentWidth);
6+
return Math.abs(doc.defaultView!.innerWidth - documentWidth);
77
}

0 commit comments

Comments
 (0)