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

Event listeners are never actually removed #423

Closed
Aaronius opened this issue Nov 3, 2016 · 0 comments
Closed

Event listeners are never actually removed #423

Aaronius opened this issue Nov 3, 2016 · 0 comments
Assignees
Labels

Comments

@Aaronius
Copy link

Aaronius commented Nov 3, 2016

In my particular case, I'm trying to disable auto-resizing from the iframe using window.parentIframe.autoResize(false); but it remains enabled. The reason is because the logic to remove event listeners isn't correct.

Take a look at manageEventListeners which is called by autoResize(). It calls manageTriggerEvent multiple times. Each time manageTriggerEvent is called, manageTriggerEvent re-creates the handleEvent function meaning that when it actually goes to remove the event listener, the handleEvent function being passed to removeEventListener is not the same handleEvent function that was passed to addEventListener when the event listener was added. Because they are different functions, the event listener removal doesn't actually succeed.

Aaronius added a commit to Aaronius/iframe-resizer that referenced this issue Nov 3, 2016
@davidjbradshaw davidjbradshaw self-assigned this Dec 16, 2016
davidjbradshaw added a commit that referenced this issue Dec 16, 2016
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