diff --git a/src/Blazored.Modal/BlazoredModal.razor.js b/src/Blazored.Modal/BlazoredModal.razor.js index 0d4a6fe..106d3d8 100644 --- a/src/Blazored.Modal/BlazoredModal.razor.js +++ b/src/Blazored.Modal/BlazoredModal.razor.js @@ -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;";