Error when iframe closes
pieshop opened this issue · comments
In my app when I switch from a page with an iFrame to a new page I am getting a console error
* Uncaught TypeError: Cannot read property 'id' of null
* at onClose (index.es.js:1488)
* at chkEvent (index.es.js:633)
* at closeIFrame (index.es.js:651)
* at eval (index.es.js:1062)
* at Array.forEach (<anonymous>)
* at eval (index.es.js:1060)
* at Array.forEach (<anonymous>)
* at MutationObserver.eval (index.es.js:1058)
The error is thrown here:
[iframeSizerReact][${iframeRef.current.id}] Close event ignored, to remove the iframe update your React component
iframeRef.current is null when this message is attempted.
Would you be able to make a simple test case for me to look at?
So I think this can be fixed by changing the line about from false,
to !iframeRef.current,
Can you test this for me?
Sorry I haven't responded sooner David.
So I changed to:
warning_1(!iframeRef.current, "[iframeSizerReact][" + iframeRef.current.id + "] Close event ignored, to remove the iframe update your React component");
This is much better as it just throws a console warning:
"[iFrameSizer][Host page: iFrameResizer0] [Window resize] IFrame(iFrameResizer0) not found"
Fixed in v1.0.1
@ymor, can you create another ticket for that issue please