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

Removed DOM element #53

Open
madiyetov opened this issue May 31, 2022 · 1 comment
Open

Removed DOM element #53

madiyetov opened this issue May 31, 2022 · 1 comment

Comments

@madiyetov
Copy link

We don't remove the handleLoad listener from img when component is destroyed. In case of slow internet connection, image might be loaded after this component was destroyed (for example, inside dialog or modal). As a result we can have the next error:

TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect')
   ./node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js at line 2855
   ./node_modules/vue-inner-image-zoom/lib/vue-inner-image-zoom.umd.js at line 2724

As a fix, we should remove the event listener or add check for this.$refs.img here:
https://github.com/laurenashpole/vue-inner-image-zoom/blob/master/src/InnerImageZoom/InnerImageZoom.vue#L266

@laurenashpole
Copy link
Owner

Thanks for flagging this! I'll add a fix in the next update.

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

No branches or pull requests

2 participants