Skip to content

Commit

Permalink
Use computed style to consider the real values (#559)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Sainty <[email protected]>
  • Loading branch information
0ptim and chrissainty authored Feb 20, 2024
1 parent fb50c41 commit 9095e1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Blazored.Modal/BlazoredModal.razor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const el = document.body;
const originalProps = {overflow: el.style.overflow, paddingRight: el.style.paddingRight};
const computedBodyStyle = getComputedStyle(el);
const originalProps = { overflow: computedBodyStyle.overflow, paddingRight: computedBodyStyle.paddingRight };
const getScrollBarWidth = () => {
let el = document.createElement("div");
el.style.cssText = "overflow:scroll; visibility:hidden; position:absolute;";
Expand Down

0 comments on commit 9095e1f

Please sign in to comment.