Skip to content

Commit

Permalink
Merge pull request #4 from eyra/resize-observer
Browse files Browse the repository at this point in the history
Added resize observer
  • Loading branch information
vloothuis authored Dec 8, 2023
2 parents fd1600e + f6ca14e commit 615acfe
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 615acfe

Please sign in to comment.