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
We don't remove the
handleLoad
listener fromimg
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: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