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 8ca870d commit f6ca14e
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 @@ -28,3 +28,11 @@ if (process.env.REACT_APP_BUILD!=='standalone' && process.env.NODE_ENV === 'prod
console.log('Running with fake storage')
run(new FakeStorage())
}

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 f6ca14e

Please sign in to comment.