Skip to content

Commit

Permalink
Added resize observer
Browse files Browse the repository at this point in the history
  • Loading branch information
mellelieuwes committed Dec 8, 2023
1 parent f3f35f0 commit c9c192d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,11 @@ if (process.env.REACT_APP_BUILD !== 'standalone' && process.env.NODE_ENV === 'pr
console.log('Running with fake bridge')
run(new FakeBridge(), 'en')
}

const observer = new ResizeObserver(() => {
const height = window.document.body.scrollHeight;
const action = "resize"
window.parent.postMessage({action, height}, "*")
});

observer.observe(window.document.body);

0 comments on commit c9c192d

Please sign in to comment.