Skip to content

Commit

Permalink
Use computed style to consider the real values
Browse files Browse the repository at this point in the history
  • Loading branch information
0ptim committed Feb 20, 2024
1 parent 81b78b2 commit 787324f
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 787324f

Please sign in to comment.