-
Notifications
You must be signed in to change notification settings - Fork 108
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
Unpaired bindEvent/unbindEvent with reload() #226
Comments
@priandsf Thank you for the contribution! Let's see what's going on here... I made some test of 3 series of 5 reloads:
The result is below You see, a number of Listeners does not increase. Also, I don't see increasing number of "scroll" listeners via getEventListeners and Event Listeners inspector. Assigning the same function as a new listener must not lead to duplication. That's for example how addEventListener works:
But we are using jQlite's We don't see any side-effects due to rareness of the reload calls and due to some conditional protections in the ui-scroll code (expensive logic don't being executed in the result of duplicate listeners triggering). But I agree with you, this should be fixed. As a solution I would prefer to have |
Thanks! I created the pull request #227 I agree with your findings, although we had a different use case. Because the directive attributes are not observed (and it is ok), we have to fully reset the directive (delete/recreate) when we want to change one of them, namely the new |
@priandsf The PR is merged, I'm going to make a release in these 2 days. |
angular-ui-scroll v1.7.5 have been released |
We just found out that a call to
reload()
does not unbind the resize/scroll events, while the events are bound again when the data is loaded.Steps to reproduce:
Reload100
demo appbindEvents()
&unbindEvents()
bindEvents
but not onunbindEvents
Possible solutions:
The text was updated successfully, but these errors were encountered: