Closed adambullmer closed 7 years ago
I believe I still have the issue. (Maybe linked to the fact that I had multiples instances on the same page ?)
I think you should also assign your requestAnimationFrame
to a variable so that you can call cancelAnimationFrame to clean up the component entirely.
I believe the right place would be below that line: https://github.com/apertureless/vue-parallax/blob/2f131f2ab51341d82adf8f9cb138ee0f8c56d16e/src/components/Parallax.vue#L127
Expected Behavior
If I am on a page with the parallax component on it, navigate to a new page in the app, I expect the scroll event listener to no longer fire.
Actual Behavior
When I visit a page with the parallax element, and then navigate to another page without it, when I scroll, I get bombarded with console errors. I source dived a little and found that there isn't a defined cleanup for this component, like turning off the scroll event listener.
Environment
10.13.1
1.2.0
2.4.2
1.0.3