Skip to content

Commit

Permalink
fix(web): plugin iframe has an incorrect size (#1149)
Browse files Browse the repository at this point in the history
  • Loading branch information
airslice authored Sep 19, 2024
1 parent 08d5d27 commit 13e4f7e
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 13e4f7e

Please sign in to comment.