Skip to content

Commit

Permalink
fix: remove scroll bar size
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice committed Sep 19, 2024
1 parent 08d5d27 commit 982b7af
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,8 @@ export default function useHook({
const st = win.getComputedStyle(html, "");
horizontalMargin = parseInt(st.getPropertyValue("margin-left"), 10) + parseInt(st.getPropertyValue("margin-right"), 10);
verticalMargin = parseInt(st.getPropertyValue("margin-top"), 10) + parseInt(st.getPropertyValue("margin-bottom"), 10);
const horizontalScrollbarHeight = window.innerHeight - document.documentElement.clientHeight;
const verticalScrollbarWidth = window.innerWidth - document.documentElement.clientWidth;
const width = html.offsetWidth + horizontalMargin + verticalScrollbarWidth;
const height = html.offsetHeight + verticalMargin + horizontalScrollbarHeight;
const width = html.offsetWidth + horizontalMargin;
const height = html.offsetHeight + verticalMargin;
if(parent){
parent.postMessage({
[${JSON.stringify(autoResizeMessageKey)}]: { width, height }
Expand Down

0 comments on commit 982b7af

Please sign in to comment.