iframe-resizer-react: resizer not working

I had previously this issue, which I fixed by copying the resizing file on my own static folder.

So, the required external javascript is now available on the page as I can see on the <head> and I also checked it is loading properly.

<script src="/js/iframeResizer.contentWindow.min.js" data-react-helmet="true"></script>

That did not fix the resizing issue though. It still shows an <iframe> of about 150px height. The content in question is available. I tested both with image and pdf files.

This is the iframe-resizer component:

                     <IframeResizer
                        log
                        src={src}
                        checkOrigin={[
                            'http://127.0.0.1:8000',
                            'http://127.0.0.1:8001',
                            'http://localhost',
                            'http://localhost:8000',
                        ]}
                        style={{ width: '1px', minWidth: '100%' }}
                        heightCalculationMethod="bodyOffset"
                    />

This is the log output:

Screenshot 2020-04-06 at 10 47 44

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16 (4 by maintainers)

Most upvoted comments

That would be extremely odd. It’s called ‘resizer’ for a reason.

From read.me:

This library is the official React interface for iframe-resizer, which enables the automatic resizing of the height and width of both same and cross domain iFrames to fit their contained content. It provides a range of features to address the most common issues with using iFrames, these include:

Height and width resizing of the iFrame to content size.