Skip to content

Commit

Permalink
[material-ui][Drawer] Fix issue with main window being used instead o…
Browse files Browse the repository at this point in the history
…f iframe's window (#43818)
  • Loading branch information
albarv340 committed Sep 20, 2024
1 parent ca7ffd6 commit aba3bc9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
export default function getScrollbarSize(doc: Document): number {
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
const documentWidth = doc.documentElement.clientWidth;
return Math.abs(window.innerWidth - documentWidth);
return Math.abs(doc.defaultView!.innerWidth - documentWidth);
}

0 comments on commit aba3bc9

Please sign in to comment.