Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't close an iframe whose height and width are 0 #170

Closed
ReedD opened this issue Mar 16, 2015 · 5 comments
Closed

Can't close an iframe whose height and width are 0 #170

ReedD opened this issue Mar 16, 2015 · 5 comments
Labels

Comments

@ReedD
Copy link
Contributor

ReedD commented Mar 16, 2015

If you attempt to close an iframe whose height and width is zero no change is detected and the iframe remains in the DOM of the parent window. My current work around is to call window.parentIFrame.size(1, 1) and then subsequently call window.parentIFrame.close() so that a change is registered.

@davidjbradshaw
Copy link
Owner

This is a browser bug.

If you add the following to line 120, does it fix it for you?

var style = messageData.iframe.style;
style['height']  = style['width'] = '1px';

@ReedD
Copy link
Contributor Author

ReedD commented Mar 16, 2015

Nope, the event never makes it out of iframeSizer.contentWindow.js.

@davidjbradshaw
Copy link
Owner

Strange. Do you have a simple test case? Can you paste the log from it.

@ReedD
Copy link
Contributor Author

ReedD commented Mar 16, 2015

I created a pull request for this and referenced the line of code I believe is causing the issue.

@davidjbradshaw
Copy link
Owner

Fixed #171.

Thanks Merged. Will do a release at the weekend, when I have a chance to look at a couple of other things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants