You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Aaronius
added a commit
to Aaronius/iframe-resizer
that referenced
this issue
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 byautoResize()
. It callsmanageTriggerEvent
multiple times. Each timemanageTriggerEvent
is called,manageTriggerEvent
re-creates thehandleEvent
function meaning that when it actually goes to remove the event listener, thehandleEvent
function being passed toremoveEventListener
is not the samehandleEvent
function that was passed toaddEventListener
when the event listener was added. Because they are different functions, the event listener removal doesn't actually succeed.The text was updated successfully, but these errors were encountered: